怎样用CSS将着四个div实现同一条线,水平居中?代码如下:<html><head><title></title><style type="text/css">.one{border:2px solid red;width:250px;height:50px;text-align:center;background:#999;

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 00:23:34
怎样用CSS将着四个div实现同一条线,水平居中?代码如下:<html><head><title></title><style type="text/css">.one{border:2px solid red;width:250px;height:50px;text-align:center;background:#999;

怎样用CSS将着四个div实现同一条线,水平居中?代码如下:<html><head><title></title><style type="text/css">.one{border:2px solid red;width:250px;height:50px;text-align:center;background:#999;
怎样用CSS将着四个div实现同一条线,水平居中?

代码如下:
<html>
<head>
<title></title>
<style type="text/css">
.one{
border:2px solid red;
width:250px;
height:50px;
text-align:center;
background:#999;
    float:left;}
.two{
border:2px solid red;
width:250px;
height:50px;
text-align:center;
background:#066;
float:left;}
.three{
border:2px solid red;
width:250px;
height:50px;
text-align:center; 
background:#C90;
float:left;}
.four{
border:2px solid red;
width:250px;
height:50px;
text-align:center; 
background:#F6F;float:left;}
</style>
</head>
<body>
<div class="one">one</div>
  <div class="two">two</div>
  <div class="three">three</div>
  <div class="four">four</div>
</body>
</html>

怎样用CSS将着四个div实现同一条线,水平居中?代码如下:<html><head><title></title><style type="text/css">.one{border:2px solid red;width:250px;height:50px;text-align:center;background:#999;

设置它们的父级,如body:text-align:center;

给它们一个包含框如div,并设置:width、margin:0 auto;


<div id="d1">

        <div class="i">one</div>

      <div class="i">two</div>

      <div class="i">three</div>

      <div class="i">four</div>

</div>


#d1{text-align:center;}

.i{display:inline;margin: 0 auto; }

怎样用CSS将着四个div实现同一条线,水平居中?代码如下:<html><head><title></title><style type="text/css">.one{border:2px solid red;width:250px;height:50px;text-align:center;background:#999; 什么是DIV+CSS,DIV+CSS有什么优点? CSS+DIV写盒子模型图 DIV+CSS几个主要知识点的总结 如何运用一句话概括DIV+CSS布局 什么是CSS+DIV?有什么优势? div css如何实现子DIV水平居中?外面的DIV宽度不定.里面有个子DIV宽度也不定.这种情况下.如何实现子DIV的宽度剧中?查询查询查询查询查询查询查询查询查询查询查询查询查询查询我要实现3个FIN DIV+CSS实现两边自适应宽度,中间固定宽度只知道中间自适应宽度,中间固定宽度,然后旁边100%的延伸出去?请问这个怎么写? 如何用css定义div的边框颜色 CSS中DIV层次怎么定义?怎么写? 怎样快速提高CSS+div的写作速度 div css 谁有英文简介的翻译 简述CSS+DIV的含义.帮我简述CSS+DIV的含义,只要含义的哦.谢啦. html+css和Div+Css有什么区别?又和PHP+MySQL有什么区别.... css样式表中,如何将一个DIV标签相对于另外一个DIV进行绝对定位 需要将div2定位于div1的某个位置.div1 长宽不确定.也可以相对定位,但需要看到div1的内容和div2的内容. div+css中ul.ol.dl什么区别?分别在什么时候用它们? DIV+CSS * { margin:0;padding:0;border:1px solid red;} div+css position是什么意思?position:absolute;position:fixed;position:inherit;position:relative;position:static