如何在它们之间添加空格并使文本保持同一行 [英] How can I add a space between them and keep text same line

查看:27
本文介绍了如何在它们之间添加空格并使文本保持同一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在这两个图像之间添加一个空格,并且不允许文本在页面中心中断?这是一个大学项目,我以前从未编程过.我实际上不知道这个模板上发生了什么我必须编辑..我只需要在图像圈中添加一个人的照片(我知道如何)和他们的评论文本,但图像一直在消失位置和文本在中间中断..

/*TEMPLTED 的地平线templated.co @templatedco根据知识共享署名 3.0 许可免费发布 (templated.co/license)*/@import url("font-awesome.min.css");@import url("http://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700,800,900");/* 基本的 */}身体 {背景:#222833;}身体,输入,选择,文本区域{颜色:#555555;font-family: 'Raleway', sans-serif;字体大小:13pt;字体粗细:300;行高:1.75em;}一种 {颜色:#3ac984;文字装饰:下划线;}一个:悬停{文字装饰:无;}强的,乙{字体粗细:700;}em,一世 {字体样式:斜体;}p,呃,哦,dl,桌子,块引用 {边距:0 0 2em 0;}h1,h2,h3,h4,h5,h6{颜色:继承;字体粗细:700;行高:1.75em;底边距:1em;}h1,h2 a,h3a,h4a,h5a,h6 a {颜色:继承;文字装饰:无;}h2{字体大小:1.5em;}h3{字体大小:1.25em;}子{字体大小:0.8em;位置:相对;顶部:0.5em;}补{字体大小:0.8em;位置:相对;顶部:-0.5em;}小时{边框顶部:实心 1px #888888;边框:0;底边距:1.5em;}块引用 {左边框:实心 0.5em #888888;字体样式:斜体;填充:1em 0 1em 2em;}特别版,文章.特别{文本对齐:居中;}标题.主要{填充底部:4em;}标题 h2 {边距:0;填充:0;字体大小:3em;字体粗细:600;}标题.byline {字体大小:1.6em;}页脚>:最后一个孩子 {底边距:0;}页脚.主要{填充顶部:3em;}/* 形式 */输入[类型=文本"],输入[类型=密码"],输入[类型=电子邮件"],文本区域{-moz-外观:无;-webkit 外观:无;-o-外观:无;-ms-外观:无;外观:无;背景:无;边框:实心 1px #888888;颜色:继承;显示:块;大纲:0;填充:0.75em;文字装饰:无;宽度:100%;}输入[类型=文本"]:焦点,输入[类型=密码"]:焦点,输入[类型=电子邮件"]:焦点,文本区域:焦点{边框颜色:#3ac984;}输入[类型=文本"],输入[类型=密码"],输入[类型=电子邮件"] {行高:1em;}::-webkit-input-placeholder {颜色:继承;不透明度:0.5;位置:相对;顶部:3px;}:-moz-占位符{颜色:继承;不透明度:0.5;}::-moz-占位符{颜色:继承;不透明度:0.5;}:-ms-input-placeholder {颜色:继承;不透明度:0.5;}.formerize-占位符{颜色:rgba(85, 85, 85, 0.5) !重要;}/* 图片 */.图片 {边框:0;位置:相对;}.image.fit {显示:块;}.image.fit img {显示:块;宽度:100%;}.image.feature {显示:块;边距:0 0 2em 0;}.image.feature img {显示:块;宽度:100%;}.image.feature2 {显示:块;边距:0 0 5em 0;}.image.feature2 img {显示:块;宽度:100%;边界半径:50%;宽度:200px;高度:200px;浮动:左边距 40px;}/* 图标 */.图标 {位置:相对;}.icon:之前{内容: "";-moz-osx-font-smoothing:灰度;-webkit-font-smoothing:抗锯齿;字体系列:FontAwesome;字体样式:正常;字体粗细:正常;文本转换:无!重要;}.icon>.label {显示:无;}/* 列表 */ol.default {列表样式:十进制;填充左:1.25em;}ol.default li {填充左:0.25em;}ul{边距:0;填充:0;}ul.default {列表样式:无;}ul.default li {显示:块;填充:0.60em 0;边框顶部:1px 实心;边框颜色:rgba(192, 192, 192, 0.15);}ul.default>:第一个孩子 {填充顶部:0;边框顶部:无;}ul.icons {光标:默认;}ul.icons li {显示:内联块;行高:1em;padding-left: 0.5em;}ul.icons li:第一个孩子{填充左:0;}ul.actions {光标:默认;}ul.actions:last-child {底边距:0;}ul.actions li {显示:内联块;填充:0 0 0 1.5em;}ul.actions li:first-child {填充:0;}ul.actions.vertical li {显示:块;填充:1.5em 0 0 0;}ul.actions.vertical li:first-child {填充:0;}ul.联系李{填充:1.05em 0;边框顶部:1px 实心;边框颜色:rgba(192, 192, 192, 0.15);}ul.contact li>span {显示:内联块;}ul.contact li .address,ul.contact li .mail,ul.contact li .phone {向左飘浮;宽度:100px;字体粗细:600;}联系方式>:第一个孩子 {填充顶部:0;边框顶部:无;}ul.style li {清楚:两者;显示:块;填充顶部:3em;}ul.style>:第一个孩子 {填充顶部:0;}ul.style h3 {显示:块;边距:0;填充底部:0.50em;字体大小:1.1em;字体粗细:700;颜色:#404040;}ul.style .fa {向左飘浮;显示:内联块;宽度:80px;高度:80px;右边距:1em;背景:#3ac984;行高:80px;文本对齐:居中;边框半径:10px;字体大小:2em;白颜色;}ul.list {列表样式:无;}ul.list li {显示:块;填充:0.60em 0;边框顶部:1px 实心;边框颜色:红色;}ul.list>:第一个孩子 {填充顶部:0;边框顶部:无;}/* 表格 */桌子 {宽度:100%;}表.默认{宽度:100%;}table.default tbody tr {边框底部:实心 1px #888888;}table.default td {填充:0.5em 1em 0.5em 1em;}table.default th {字体粗细:700;填充:0.5em 1em 0.5em 1em;文本对齐:左;}table.default 头{背景:#555555;颜色:#fff;}/* 按钮 */输入[类型=提交"],输入[类型=重置"],输入[类型=按钮"],.按钮 {-moz-外观:无;-webkit 外观:无;-o-外观:无;-ms-外观:无;外观:无;-moz-transition:背景颜色 0.2 秒缓入缓出;-webkit-transition: 背景色 0.2s 缓入缓出;-o-transition: 背景色 0.2s 缓入缓出;-ms-transition:背景色 0.2 秒缓入缓出;过渡:背景色 0.2 秒缓入缓出;背景:#3ac984;边框半径:40px;边框:0;白颜色;光标:指针;显示:内联块;填充:0.80em 2em;文本对齐:居中;文字装饰:无;字体大小:1.4em;字体粗细:600;最小宽度:10em;}输入[类型=提交"]:悬停,输入[类型=重置"]:悬停,输入[类型=按钮"]:悬停,.button:悬停{背景颜色:#32b777;}输入[type="submit"].fit,输入[type="reset"].fit,输入[type="button"].fit,.button.fit {宽度:100%;}输入[type="submit"].small,输入[type="reset"].small,输入[type="button"].small,.button.small {字体大小:0.8em;}/* 包装器 */.wrapper.style1 {背景:#fff;}.wrapper.style2 {背景:#ececec;填充:6em 0;文本对齐:居中;}.wrapper.style4 {背景:#ececec;填充:1em 0;文本对齐:居中;}.wrapper.style3 {填充:2em 0 3.5em 0;背景:#ececec;}.wrapper.style3 跨度{显示:内联块;填充顶部:0.80em;字体大小:2em;字体粗细:600;}.wrapper.style3 .button {浮动:对;}/* 标题 */#header {背景:#333333 url("../images/pic01.jpg") 不重复;背景尺寸:封面;颜色:#fff;填充:6em 0;文本对齐:居中;背景位置:0% 65%;位置:相对;}#header:之前{内容: '';位置:绝对;左:0;顶部:0;宽度:100%;高度:100%;背景:RGBA(16, 32, 48, 0.25);}#header>* {位置:相对;z-索引:1;}.homepage #header {填充:8em 0;背景位置:中心;}#标识 {字体大小:2em;}#nav>ul {边距:0;}#nav>ul>li {边界半径:10px 10px 0 0;显示:内联块;左边距:0.5em;填充:0.5em 1.5em;}#nav>ul>li a {颜色:#FFF;文字装饰:无;字体大小:1.2em;}#nav>ul>li:first-child {左边距:0;}#nav>ul>li: 悬停一个 {颜色:#fff;}#nav>ul>li.active {背景:#3ac984;}#nav>ul>li.active a {白颜色;}#nav>ul>li>ul {显示:无;}/* 投影仪 */.dropotron {边距顶部:-2px;背景:#3ac984;边框半径:10px;白颜色;最小宽度:12em;填充:1em 0;}.dropotron>li {行高:2em;填充:0 1em;}.dropotron>li>a {颜色:#FFF;文字装饰:无;}.dropotron>li.active>a,.dropotron>li:hover>a {颜色:#FFF;}.dropotron.level-0 {边框半径:0 10px 10px 10px;字体大小:1em;}/* 横幅 */#横幅 {文本对齐:居中;填充:4em 0 0 0;}#banner .major h2 {字体大小:3.5em;}#banner .major .byline {显示:块;边距:0em 2em;行高:1.6em;字体大小:1.5em;}#横幅{颜色:继承;}/* 主要的 */.no-sidebar #main .major,.left-sidebar #main .major,.right-sidebar #main .major {文本对齐:左;}.homepage #main .major {文本对齐:居中;}#主要的 {填充:6em 0;}#main .sidebar .major {填充底部:2em;}#main .sidebar .major h2 {字体大小:1.8em;}#main .sidebar .default li {边框颜色:#cdcdcd;}#main .sidebar .default a {颜色:#464646;}#main .sidebar>:第一个孩子 {底边距:3em;}/*页脚*/#页脚{填充:4em 0;颜色:#fff;}#footer .major h2 {字体大小:2em;颜色:#FFF;}#footer .major .byline {字体大小:1.1em;}#footer .copyright {边距顶部:3em;填充顶部:3em;边框顶部:1px 实心;边框颜色:rgba(192, 192, 192, 0.15);文本对齐:居中;颜色:继承;}#footer a {颜色:继承;}#中间 {高度:600px;宽度:300px;背景:绿色;}

<!--TEMPLTED 的地平线templated.co @templatedco根据知识共享署名 3.0 许可免费发布 (templated.co/license)--><头><title>地平线 by TEMPLATED</title><meta http-equiv="content-type" content="text/html; charset=utf-8"/><meta name="description" content=""/><meta name="keywords" content=""/><!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]--><script src="js/jquery.min.js"></script><script src="js/jquery.dropotron.min.js"></script><script src="js/skel.min.js"></script><script src="js/skel-layers.min.js"></script><script src="js/init.js"></script><noscript><link rel="stylesheet" href="css/skel.css"/><link rel="stylesheet" href="css/style.css"/></noscript><!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css"/><![endif]--><body class="主页"><!-- 标题--><div id="标题"><div class="容器"><!-- 标志 --><h1><a href="#" id="logo">Vista 702</a></h1><!-- 导航 --><nav id="导航"><ul><li><a href="#fotos">照片</a></li><li><a href="#depoimentos">Depoimentos</a></li><li><a href="#planos">Planos</a></li></nav><!-- 横幅--><div id="横幅"><div class="容器"><部分><header class="major"><h2>Vista 702</h2><span class="byline">&hellip;a melhor vista de Juiz de Fora para se passar o feriado, réveillon e comemorações em geral.</span></标题><a href="#" class="button alt">注册</a></节>

<!-- 精选--><div class="wrapper style2"><section class="容器"><header class="major"><a id="照片"></a><h2>照片</h2><span class="byline">Suavisita começa aqui.</span></标题><div class="row no-collapse-1"><section class="4u"><a class="图像特征"><img src="images/pic02.jpg" alt=""></a><p>Nam in massa.Sed veltellus.Curabitur sem urna,consequat vel,suscipit in,mattis placerat. </p></节><section class="4u"><a class="图像特征"><img src="images/pic03.jpg" alt=""></a><p>Donec ornare neque ac sem.毛里求斯.Aliquam sem leo, vulputate sed, convallis.Donec magna.</p></节><section class="4u"><a class="图像特征"><img src="images/pic04.jpg" alt=""></a><p>Curabitur sem urna, consequat vel, suscipit convallis sem leo, mattis placerat, nulla.</p></节>

</节>

<div class="wrapper style2"><section class="容器"><header class="major"><a id="depoimentos"></a><h2>Depoimentos</h2><span class="byline">Os viajantes recomendam.</span></标题><div class="row no-collapse-1"><section class=""><a class="image feature2"><img src="https://abrilexame.files.wordpress.com/2016/09/size_960_16_9_google-robert-bunsen.jpg" align="left"=""></a><p>Nam in massa.Sed veltellus.Curabitur sem urna,consequat vel,suscipit in,mattis placerat. </p></节><section class=""><a class="image feature2"><img src="https://eduardhosp-alemao.com.br/wp-content/uploads/2018/05/Hashtag-Google-Alem%C3%A3o-Sem-Complica%C3%A7%C3%A3o.jpg" align="left"></a><p>Curabitur sem urna, consequat vel, suscipit convallis sem leo, mattis placerat, nulla.</p></节>

</节>

<!-- 主要--><div id="main" class="wrapper style1"><section class="容器"><header class="major"><a id="planos"></a><h2>Uma janelas, diversas</h2><span class="byline">Um plano para todos os bolsos.</span></标题><div class="row"><!-- 内容--><div class="6u"><部分><ul class="style"><li><span class="fa fa-wrench"></span><h3>整数 ultrices</h3><span>在 posuere eleifend odio 中.古色古香的 semper augue mattis wisi.Maecenas ligula.Pellentesque viverra vulputate enim.</span><li><span class="fa fa-cloud"></span><h3>金银花</h3><span>Pellentesque viverra vulputate enim.Aliquam 时代 volutpat.Maecenas condimentum enim tincidunt risus accumsan.</span></节>

<div class="6u"><部分><ul class="style"><li><span class="fa fa-cogs"></span><h3>整数 ultrices</h3><span>在 posuere eleifend odio 中.古色古香的 semper augue mattis wisi.Maecenas ligula.Pellentesque viverra vulputate enim.</span><li><span class="fa fa-leaf"></span><h3>金银花</h3><span>Pellentesque viverra vulputate enim.Aliquam 时代 volutpat.Maecenas condimentum enim tincidunt risus accumsan.</span></节>

</节>

<!-- 页脚--><div id="页脚"><div class="容器"><!-- 列表--><div class="row"><div class="8u"><部分><header class="major"><h2>多内克格言</h2><span class="byline">Quisque semper augue mattis wisi maecenas ligula</span></标题><div class="row"><section class="6u"><ul class="default"><li><a href="#">Pellentesque elit non gravida blandit.</a></li><li><a href="#">Lorem ipsum dolor consectetuer elit.</a></li><li><a href="#">Phasellus nibh pellentesque congue.</a></li><li><a href="#">Cras vitae metus aliquam pharetra.</a></li></节><section class="6u"><ul class="default"><li><a href="#">Pellentesque elit non gravida blandit.</a></li><li><a href="#">Lorem ipsum dolor consectetuer elit.</a></li><li><a href="#">Phasellus nibh pellentesque congue.</a></li><li><a href="#">Cras vitae metus aliquam pharetra.</a></li></节>

</节>

<div class="4u"><部分><header class="major"><h2>多内克格言</h2><span class="byline">Mattis wisi maecenas ligula</span></标题><ul class="联系人"><li><span class="address">地址</span><span>1234 Somewhere Road #4285 <br/>纳什维尔,田纳西州 00000</span><li><span class="mail">Mail</span><span><a href="#">someone@untitled.tld</a></span><li><span class="phone">电话</span><span>(000) 000-0000</span></节>

<!-- 版权所有--><div class="版权">设计:<a href="http://templated.co">TEMPLATED</a>图片:<a href="http://unsplash.com">Unsplash</a>(<a href="http://unsplash.com/cc0">CC0</a>)

<a id="中间"></a></html>

谢谢

解决方案

只需在文本元素上使用 white-space: nowrap 即可使文本保持在同一行,无论父元素大小如何.

对于图像,您需要在父容器上添加 marginpadding.

.4up {空白:nowrap;}

.4u{填充:0.23em;}

.4u{边距:0.23em;}

how can I add a space between those 2 images and dont allow the text to break on the center of the page? It's for a college project and I've never programmed before. i actually dont know whats going on on this template i have to edit.. i just need to add a photo of a person in the image circle (which i know how to) and a text of their review, but the images keep going off position and text breaks in the middle..

/*
	Horizons by TEMPLATED
	templated.co @templatedco
	Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
*/

@import url("font-awesome.min.css");
@import url("http://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700,800,900");

/* Basic */


}
body {
  background: #222833;
}
body,
input,
select,
textarea {
  color: #555555;
  font-family: 'Raleway', sans-serif;
  font-size: 13pt;
  font-weight: 300;
  line-height: 1.75em;
}
a {
  color: #3ac984;
  text-decoration: underline;
}
a:hover {
  text-decoration: none;
}
strong,
b {
  font-weight: 700;
}
em,
i {
  font-style: italic;
}
p,
ul,
ol,
dl,
table,
blockquote {
  margin: 0 0 2em 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  color: inherit;
  font-weight: 700;
  line-height: 1.75em;
  margin-bottom: 1em;
}
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
  color: inherit;
  text-decoration: none;
}
h2 {
  font-size: 1.5em;
}
h3 {
  font-size: 1.25em;
}
sub {
  font-size: 0.8em;
  position: relative;
  top: 0.5em;
}
sup {
  font-size: 0.8em;
  position: relative;
  top: -0.5em;
}
hr {
  border-top: solid 1px #888888;
  border: 0;
  margin-bottom: 1.5em;
}
blockquote {
  border-left: solid 0.5em #888888;
  font-style: italic;
  padding: 1em 0 1em 2em;
}
section.special,
article.special {
  text-align: center;
}
header.major {
  padding-bottom: 4em;
}
header h2 {
  margin: 0;
  padding: 0;
  font-size: 3em;
  font-weight: 600;
}
header .byline {
  font-size: 1.6em;
}
footer> :last-child {
  margin-bottom: 0;
}
footer.major {
  padding-top: 3em;
}

/* Form */
input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  -moz-appearance: none;
  -webkit-appearance: none;
  -o-appearance: none;
  -ms-appearance: none;
  appearance: none;
  background: none;
  border: solid 1px #888888;
  color: inherit;
  display: block;
  outline: 0;
  padding: 0.75em;
  text-decoration: none;
  width: 100%;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: #3ac984;
}
input[type="text"],
input[type="password"],
input[type="email"] {
  line-height: 1em;
}
::-webkit-input-placeholder {
  color: inherit;
  opacity: 0.5;
  position: relative;
  top: 3px;
}
:-moz-placeholder {
  color: inherit;
  opacity: 0.5;
}
::-moz-placeholder {
  color: inherit;
  opacity: 0.5;
}
:-ms-input-placeholder {
  color: inherit;
  opacity: 0.5;
}
.formerize-placeholder {
  color: rgba(85, 85, 85, 0.5) !important;
}

/* Image */
.image {
  border: 0;
  position: relative;
}
.image.fit {
  display: block;
}
.image.fit img {
  display: block;
  width: 100%;
}
.image.feature {
  display: block;
  margin: 0 0 2em 0;
}
.image.feature img {
  display: block;
  width: 100%;
}
.image.feature2 {
  display: block;
  margin: 0 0 5em 0;
}
.image.feature2 img {
  display: block;
  width: 100%;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  float: left margin 40px;
}

/* Icon */
.icon {
  position: relative;
}
.icon:before {
  content: "";
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-family: FontAwesome;
  font-style: normal;
  font-weight: normal;
  text-transform: none !important;
}
.icon>.label {
  display: none;
}

/* Lists */
ol.default {
  list-style: decimal;
  padding-left: 1.25em;
}
ol.default li {
  padding-left: 0.25em;
}
ul {
  margin: 0;
  padding: 0;
}
ul.default {
  list-style: none;
}
ul.default li {
  display: block;
  padding: 0.60em 0;
  border-top: 1px solid;
  border-color: rgba(192, 192, 192, 0.15);
}
ul.default> :first-child {
  padding-top: 0;
  border-top: none;
}
ul.icons {
  cursor: default;
}
ul.icons li {
  display: inline-block;
  line-height: 1em;
  padding-left: 0.5em;
}
ul.icons li:first-child {
  padding-left: 0;
}
ul.actions {
  cursor: default;
}
ul.actions:last-child {
  margin-bottom: 0;
}
ul.actions li {
  display: inline-block;
  padding: 0 0 0 1.5em;
}
ul.actions li:first-child {
  padding: 0;
}
ul.actions.vertical li {
  display: block;
  padding: 1.5em 0 0 0;
}
ul.actions.vertical li:first-child {
  padding: 0;
}
ul.contact li {
  padding: 1.05em 0;
  border-top: 1px solid;
  border-color: rgba(192, 192, 192, 0.15);
}
ul.contact li>span {
  display: inline-block;
}
ul.contact li .address,
ul.contact li .mail,
ul.contact li .phone {
  float: left;
  width: 100px;
  font-weight: 600;
}
ul.contact> :first-child {
  padding-top: 0;
  border-top: none;
}
ul.style li {
  clear: both;
  display: block;
  padding-top: 3em;
}
ul.style> :first-child {
  padding-top: 0;
}
ul.style h3 {
  display: block;
  margin: 0;
  padding-bottom: 0.50em;
  font-size: 1.1em;
  font-weight: 700;
  color: #404040;
}
ul.style .fa {
  float: left;
  display: inline-block;
  width: 80px;
  height: 80px;
  margin-right: 1em;
  background: #3ac984;
  line-height: 80px;
  text-align: center;
  border-radius: 10px;
  font-size: 2em;
  color: white;
}
ul.list {
  list-style: none;
}
ul.list li {
  display: block;
  padding: 0.60em 0;
  border-top: 1px solid;
  border-color: red;
}
ul.list> :first-child {
  padding-top: 0;
  border-top: none;
}

/* Tables */
table {
  width: 100%;
}
table.default {
  width: 100%;
}
table.default tbody tr {
  border-bottom: solid 1px #888888;
}
table.default td {
  padding: 0.5em 1em 0.5em 1em;
}
table.default th {
  font-weight: 700;
  padding: 0.5em 1em 0.5em 1em;
  text-align: left;
}
table.default thead {
  background: #555555;
  color: #fff;
}

/* Button */
input[type="submit"],
input[type="reset"],
input[type="button"],
.button {
  -moz-appearance: none;
  -webkit-appearance: none;
  -o-appearance: none;
  -ms-appearance: none;
  appearance: none;
  -moz-transition: background-color 0.2s ease-in-out;
  -webkit-transition: background-color 0.2s ease-in-out;
  -o-transition: background-color 0.2s ease-in-out;
  -ms-transition: background-color 0.2s ease-in-out;
  transition: background-color 0.2s ease-in-out;
  background: #3ac984;
  border-radius: 40px;
  border: 0;
  color: white;
  cursor: pointer;
  display: inline-block;
  padding: 0.80em 2em;
  text-align: center;
  text-decoration: none;
  font-size: 1.4em;
  font-weight: 600;
  min-width: 10em;
}
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
.button:hover {
  background-color: #32b777;
}
input[type="submit"].fit,
input[type="reset"].fit,
input[type="button"].fit,
.button.fit {
  width: 100%;
}
input[type="submit"].small,
input[type="reset"].small,
input[type="button"].small,
.button.small {
  font-size: 0.8em;
}

/* Wrapper */
.wrapper.style1 {
  background: #fff;
}
.wrapper.style2 {
  background: #ececec;
  padding: 6em 0;
  text-align: center;
}
.wrapper.style4 {
  background: #ececec;
  padding: 1em 0;
  text-align: center;
}
.wrapper.style3 {
  padding: 2em 0 3.5em 0;
  background: #ececec;
}
.wrapper.style3 span {
  display: inline-block;
  padding-top: 0.80em;
  font-size: 2em;
  font-weight: 600;
}
.wrapper.style3 .button {
  float: right;
}

/* Header */
#header {
  background: #333333 url("../images/pic01.jpg") no-repeat;
  background-size: cover;
  color: #fff;
  padding: 6em 0;
  text-align: center;
  background-position: 0% 65%;
  position: relative;
}
#header:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 32, 48, 0.25);
}
#header>* {
  position: relative;
  z-index: 1;
}
.homepage #header {
  padding: 8em 0;
  background-position: center;
}
#logo {
  font-size: 2em;
}
#nav>ul {
  margin: 0;
}
#nav>ul>li {
  border-radius: 10px 10px 0 0;
  display: inline-block;
  margin-left: 0.5em;
  padding: 0.5em 1.5em;
}
#nav>ul>li a {
  color: #FFF;
  text-decoration: none;
  font-size: 1.2em;
}
#nav>ul>li:first-child {
  margin-left: 0;
}
#nav>ul>li:hover a {
  color: #fff;
}
#nav>ul>li.active {
  background: #3ac984;
}
#nav>ul>li.active a {
  color: white;
}
#nav>ul>li>ul {
  display: none;
}

/* Dropotron */
.dropotron {
  margin-top: -2px;
  background: #3ac984;
  border-radius: 10px;
  color: white;
  min-width: 12em;
  padding: 1em 0;
}
.dropotron>li {
  line-height: 2em;
  padding: 0 1em;
}
.dropotron>li>a {
  color: #FFF;
  text-decoration: none;
}
.dropotron>li.active>a,
.dropotron>li:hover>a {
  color: #FFF;
}
.dropotron.level-0 {
  border-radius: 0 10px 10px 10px;
  font-size: 1em;
}

/* Banner */
#banner {
  text-align: center;
  padding: 4em 0 0 0;
}
#banner .major h2 {
  font-size: 3.5em;
}
#banner .major .byline {
  display: block;
  margin: 0em 2em;
  line-height: 1.6em;
  font-size: 1.5em;
}
#banner a {
  color: inherit;
}

/* Main */
.no-sidebar #main .major,
.left-sidebar #main .major,
.right-sidebar #main .major {
  text-align: left;
}
.homepage #main .major {
  text-align: center;
}
#main {
  padding: 6em 0;
}
#main .sidebar .major {
  padding-bottom: 2em;
}
#main .sidebar .major h2 {
  font-size: 1.8em;
}
#main .sidebar .default li {
  border-color: #cdcdcd;
}
#main .sidebar .default a {
  color: #464646;
}
#main .sidebar> :first-child {
  margin-bottom: 3em;
}

/* Footer */
#footer {
  padding: 4em 0;
  color: #fff;
}
#footer .major h2 {
  font-size: 2em;
  color: #FFF;
}
#footer .major .byline {
  font-size: 1.1em;
}
#footer .copyright {
  margin-top: 3em;
  padding-top: 3em;
  border-top: 1px solid;
  border-color: rgba(192, 192, 192, 0.15);
  text-align: center;
  color: inherit;
}
#footer a {
  color: inherit;
}
#middle {
  height: 600px;
  width: 300px;
  background: green;
}

<!DOCTYPE HTML>
<!--
	Horizons by TEMPLATED
	templated.co @templatedco
	Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
-->
<html>

<head>
  <title>Horizons by TEMPLATED</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="description" content="" />
  <meta name="keywords" content="" />
  <!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
  <script src="js/jquery.min.js"></script>
  <script src="js/jquery.dropotron.min.js"></script>
  <script src="js/skel.min.js"></script>
  <script src="js/skel-layers.min.js"></script>
  <script src="js/init.js"></script>
  <noscript>
			<link rel="stylesheet" href="css/skel.css" />
			<link rel="stylesheet" href="css/style.css" />
		</noscript>
  <!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>

<body class="homepage">

  <!-- Header -->
  <div id="header">
    <div class="container">

      <!-- Logo -->
      <h1><a href="#" id="logo">Vista 702</a></h1>

      <!-- Nav -->
      <nav id="nav">
        <ul>
          <li><a href="#fotos">Fotos</a></li>
          <li><a href="#depoimentos">Depoimentos</a></li>
          <li><a href="#planos">Planos</a></li>
      </nav>


      <!-- Banner -->
      <div id="banner">
        <div class="container">
          <section>
            <header class="major">
              <h2>Vista 702</h2>
              <span class="byline">&hellip; a melhor vista de Juiz de Fora para se passar o feriado, réveillon e comemorações em geral.</span>
            </header>
            <a href="#" class="button alt">Sign Up</a>
          </section>
        </div>
      </div>

    </div>
  </div>

  <!-- Featured -->
  <div class="wrapper style2">
    <section class="container">
      <header class="major">
        <a id="fotos"></a>
        <h2>Fotos</h2>
        <span class="byline">Sua visita começa aqui.</span>
      </header>
      <div class="row no-collapse-1">
        <section class="4u">
          <a class="image feature"><img src="images/pic02.jpg" alt=""></a>
          <p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
        </section>
        <section class="4u">
          <a class="image feature"><img src="images/pic03.jpg" alt=""></a>
          <p>Donec ornare neque ac sem. Mauris aliquet. Aliquam sem leo, vulputate sed, convallis. Donec magna.</p>
        </section>
        <section class="4u">
          <a class="image feature"><img src="images/pic04.jpg" alt=""></a>
          <p>Curabitur sem urna, consequat vel, suscipit convallis sem leo, mattis placerat, nulla. Sed ac leo.</p>
        </section>
      </div>
    </section>
  </div>


  <div class="wrapper style2">
    <section class="container">
      <header class="major">
        <a id="depoimentos"></a>
        <h2>Depoimentos</h2>
        <span class="byline">Os viajantes recomendam.</span>
      </header>





      <div class="row no-collapse-1">
        <section class="">
          <a class="image feature2"><img src="https://abrilexame.files.wordpress.com/2016/09/size_960_16_9_google-robert-bunsen.jpg" align="left"=""></a>
          <p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
        </section>

        <section class="">
          <a class="image feature2"><img src="https://eduardhosp-alemao.com.br/wp-content/uploads/2018/05/Hashtag-Google-Alem%C3%A3o-Sem-Complica%C3%A7%C3%A3o.jpg" align="left"></a>
          <p>Curabitur sem urna, consequat vel, suscipit convallis sem leo, mattis placerat, nulla. Sed ac leo.</p>
        </section>
      </div>
    </section>
  </div>

  <!-- Main -->
  <div id="main" class="wrapper style1">
    <section class="container">
      <header class="major">
        <a id="planos"></a>
        <h2>Uma janelas, diversas</h2>
        <span class="byline">Um plano para todos os bolsos.</span>
      </header>
      <div class="row">

        <!-- Content -->
        <div class="6u">
          <section>
            <ul class="style">
              <li>
                <span class="fa fa-wrench"></span>
                <h3>Integer ultrices</h3>
                <span>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim.</span>
              </li>
              <li>
                <span class="fa fa-cloud"></span>
                <h3>Aliquam luctus</h3>
                <span>Pellentesque viverra vulputate enim. Aliquam erat volutpat. Maecenas condimentum enim tincidunt risus accumsan.</span>
              </li>
            </ul>
          </section>
        </div>
        <div class="6u">
          <section>
            <ul class="style">
              <li>
                <span class="fa fa-cogs"></span>
                <h3>Integer ultrices</h3>
                <span>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim.</span>
              </li>
              <li>
                <span class="fa fa-leaf"></span>
                <h3>Aliquam luctus</h3>
                <span>Pellentesque viverra vulputate enim. Aliquam erat volutpat. Maecenas condimentum enim tincidunt risus accumsan.</span>
              </li>
            </ul>
          </section>
        </div>

      </div>
    </section>
  </div>

  <!-- Footer -->
  <div id="footer">
    <div class="container">

      <!-- Lists -->
      <div class="row">
        <div class="8u">
          <section>
            <header class="major">
              <h2>Donec dictum metus</h2>
              <span class="byline">Quisque semper augue mattis wisi maecenas ligula</span>
            </header>
            <div class="row">
              <section class="6u">
                <ul class="default">
                  <li><a href="#">Pellentesque elit non gravida blandit.</a></li>
                  <li><a href="#">Lorem ipsum dolor consectetuer elit.</a></li>
                  <li><a href="#">Phasellus nibh pellentesque congue.</a></li>
                  <li><a href="#">Cras vitae metus aliquam  pharetra.</a></li>
                </ul>
              </section>
              <section class="6u">
                <ul class="default">
                  <li><a href="#">Pellentesque elit non gravida blandit.</a></li>
                  <li><a href="#">Lorem ipsum dolor consectetuer elit.</a></li>
                  <li><a href="#">Phasellus nibh pellentesque congue.</a></li>
                  <li><a href="#">Cras vitae metus aliquam  pharetra.</a></li>
                </ul>
              </section>
            </div>
          </section>
        </div>
        <div class="4u">
          <section>
            <header class="major">
              <h2>Donec dictum metus</h2>
              <span class="byline">Mattis wisi maecenas ligula</span>
            </header>
            <ul class="contact">
              <li>
                <span class="address">Address</span>
                <span>1234 Somewhere Road #4285 <br />Nashville, TN 00000</span>
              </li>
              <li>
                <span class="mail">Mail</span>
                <span><a href="#">someone@untitled.tld</a></span>
              </li>
              <li>
                <span class="phone">Phone</span>
                <span>(000) 000-0000</span>
              </li>
            </ul>
          </section>
        </div>
      </div>

      <!-- Copyright -->
      <div class="copyright">
        Design: <a href="http://templated.co">TEMPLATED</a> Images: <a href="http://unsplash.com">Unsplash</a> (<a href="http://unsplash.com/cc0">CC0</a>)
      </div>

    </div>
  </div>
  <a id="middle"></a>
</body>

</html>

thanks

解决方案

Just use white-space: nowrap on the text element to make the text stay on the same line regardless of the parents size.

And for the images, you need to either add margin or padding on the parent container.

i.e,

.4u p {
  white-space: nowrap;
}

and

.4u{
  padding: 0.23em;
}

or

.4u{
  margin: 0.23em;
}

这篇关于如何在它们之间添加空格并使文本保持同一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆