简体   繁体   English

Boostrap 3的“普通” CSS

[英]“normal” CSS to Boostrap 3

I am new to the responsive world and am using a template that is using bootstrap. 我是响应式世界的新手,正在使用使用引导程序的模板。

I have the following CSS that I would like to make responsive but I am unsure of the best way to go about it. 我有以下要响应的CSS,但不确定如何做到这一点。

I have modified the following theme 我修改了以下主题

I am wanting to move the Onesie title to the top of the page - I have shifted that code into the #siteTitleBox 我想将Onesie标题移到页面顶部-我已将代码移到#siteTitleBox

In the gap to the left of the theme I have created a new div called #text this will show data of a random post etc 在主题左侧的#text我创建了一个名为#text的新div,它将显示随机帖子的数据等

I have the location of what I want correct but I just now need help to develop it into Responsive Code. 我已经找到了我想要纠正的位置,但是现在我需要帮助将其开发为响应代码。

CSS: CSS:

#siteTitleBox
{
margin: -580px 0 0 0;
height:150px !important;
}
#text{
margin:-568px 0 0 -135px;
width:530px;
height: 100% !important;  
border:1px solid transparent;  
color: #ffffff;
background-color: rgba( 0, 0, 0, .4 );
border-color: rgba( 255, 255, 255, .9 ); 
}
#text p{
margin: -65px 5px 0 5px;
}
#text h3{
 margin:0 0 0 5px;
}
#siteTitleBox h1 a:hover{
color:#fff;
}

HTML: HTML:

<div id="siteTitleBox">Page Title</div>
<div id="text"><p>ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC ABC </p>

if u want use best way in responsive.don't use pixel base width,size.use % based 如果你想在响应中使用最好的方法。不要使用像素的基本宽度,size。使用基于%

width:50%

still you want use pixel based declaration then use different media queries in css or in html like 仍然要使用基于像素的声明,然后在CSS或HTML中使用不同的媒体查询,例如

css 的CSS

@media screen and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait){
 #text{
width:30px;} 
}`
@media screen and (device-width: 450px) and (device-height: 100px) and (orientation:portrait){
 #text{
width:320px;} 
}`

html html

<link rel="stylesheet" media="(max-width: 450px)" href="phone.css" />
<link rel="stylesheet" media="(max-width: 760px)" href="tablet.css" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM