gpt4 book ai didi

html - 我的侧边栏不在我页面的右侧,而是在我的左侧。我该如何解决?

转载 作者:行者123 更新时间:2023-11-28 15:20:14 25 4
gpt4 key购买 nike

我对 html/css 和 bootstrap 比较陌生。我正在尝试创建一个博客网站,但我的侧边栏位于页面底部而不是右侧。我该如何解决?我做错了什么?

我在下面和 https://jsfiddle.net/Mulk/9tqasmr8/#&togetherjs=T2bw0qcVNw 处有我的代码

<!DOCTYPE html>


<title>Pratice</title>

<body>


<hr id="hrstyle" />

<!--End of Logp-->
<!--Start of Blog-->
<div class="container-fluid blog">
<div class="row">
<div class=" col-xs-12 col-sm-offset-1 col-sm-8">
<div>
<h3>New Zealand</h3>
<img class="img-responsive blogpics" src="Images/ocean2.jpg" / />
<p>
We have been called many things. Travelers, by default. But we like to be called nomads. Explorers. Vagabonds. Adventurers. Wayfarers.
<a class="readmore">Read More..</a>
</p>
</div>
<div>
<h3>Munich Depth</h3>
<img class="img-responsive blogpics" src="Images/munic2.jpg" />
<p>
And that’s just the gist of it.We come from all walks of life, from bustling gray colored cities, sleepy beach towns, snow-covered metropolises, small villages nestled in between lush green mountains, we come from everywhere.
<a class="readmore">Read More..</a>
</p>

</div>

<!---Sidebar-->
<div class="col-sm-3">
<p>
SideBarLorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam, quasi, fugiat, asperiores harum voluptatum tenetur a possimus nesciunt quod SideBar
</div>

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

</body>











CSS

@import url(https://fonts.googleapis.com/css?family=Crimson+Text);
img {
max-width: 100%;
}

* {
padding: 0;
margin: 0;
box-sizing: border-box;
}

body {
background: #fff;
font-family: 'Crimson Text', serif;
line-height: 1.5;
overflow: scroll;
}

h1,
h2 {
font-family: 'Lato', sans-serif;
font-size: 2.5em;
}


/******Naviagtion*********/

nav {
width: 100%;
}

#hrstyle {
border-top-color: black;
color: black;
}


/***End Logo***/


/***Start of Blog***/

h3 {
text-transform: uppercase;
}

.readmore {
text-transform: uppercase;
display: block;
text-align: center;
margin-top: 2.5%;
border-width: 1.5px;
border-style: solid;
font-size: 1.1em;
}

.blog {
font-family: 'Crimson Text', serif;
font-size: 1.3em;
}

.blogpics {
width: 100%;
}


/****End of Blog****/

@media only screen and (min-width: 1224px) {
p {
width: 835px;
}
.blogpics {
width: 85%;
}
}

最佳答案

在您的 fiddle 中,您使用 http://而不是 https://作为 Bootstrap 资源。将 https://与 JSFiddle 一起使用显然是关键。未应用 Bootstrap 中的样式。

并且像您正在寻找的那样有两列可能是这样的:

<div class="container">
<div class="row">

<div class="col-sm-8">
<div class="row">
<div class="col-xs-12">
<div>
<h3>Title here</h3>
<img class="img-responsive blogpics" src="http://www.thetorquereport.com/lamborghini_reventon_4.jpg" />
<p>
We have been called many things. Travelers, by default. But we like to be called nomads. Explorers. Vagabonds. Adventurers. Wayfarers.
<a class="readmore">Read More..</a>
</p>
</div>
</div>
<div class="col-xs-12">
<div>
<h3>Title here</h3>
<img class="img-responsive blogpics" src="http://www.thetorquereport.com/lamborghini_reventon_4.jpg" />
<p>
We have been called many things. Travelers, by default. But we like to be called nomads. Explorers. Vagabonds. Adventurers. Wayfarers.
<a class="readmore">Read More..</a>
</p>
</div>
</div>
</div>
</div>
<!---Sidebar-->
<div class="col-sm-4">
<p>
SideBarLorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam, quasi, fugiat, asperiores harum voluptatum tenetur a possimus nesciunt quod SideBar</p>
</div>

</div>
</div>

关于html - 我的侧边栏不在我页面的右侧,而是在我的左侧。我该如何解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36121979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com