左右布局以及中文冒号造成的错误显示

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> a </title>
<style>
    .wrap{
	     width:900px;
         margin:0 auto;
		 font-size:20px;
		 text-align:center;
		 }
     #left{ width:200px;
			height:500px;
            background:#66ccff;
			float:left;		
			}
     #right{ 
			height:500px;
            background:#ccf; 
			margin-left:200px;
			}
			
			
</style>
<!--混合浮动+普通流-->
</head>


<body>
<div class="wrap">
     <aside id="left">#left</aside>
	 <section id="right">#right</section>
</div>
</body>
</html>

写的过程中 由于有一个zhon中文的冒号导致yi一直无法正确浮动。要避免中文输入法状态下的操作。还有编程软件怎么才会报错。

notepad++怎么才会在编译过程中报错

 

aside元素主要有以下两种使用方法

1)被包含在article元素中作为主要内容的附属信息部分,其中的内容可以是与当前文章有关的相关资料、名次解释,等等。

<article>
  <h1>…</h1>
  <p>…</p>
  <aside>…</aside>
</article>

2)在article元素之外使用作为页面或站点全局的附属信息部分。最典型的是侧边栏,其中的内容可以使友情链接,博客中的其它文章列表、广告单元等。

<aside>
  <h2>…</h2>
  <ul>
    <li>…</li>
    <li>…</li>
  </ul>
  <h2>…</h2>
  <ul>
    <li>…</li>
    <li>…</li>
  </ul>
</aside>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> left and right</title>
<style>
	.wrap{
			width:900px;
			height:500px;
			font-size:20px;
			text-align:center;
			overflow:hidden;
			}
	#left{
			width:200px;
			height:500px;
			background:yellow;
			float:left;}
	#right{
			width:700px;
			height:500px;
			background:red;
			float:left;}
			<!--纯浮动式实现方案,浮动的不会撑开父级元素,所以需要overflow hidden-->
</style>

</head>
<body>
<div  class="wrap">
<aside id="left"> #left</aside>
<section id="right">#right</section>
</div>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> left and right</title>
<style>
	.wrap{
			width:900px;
			height:500px;
			font-size:20px;
			text-align:center;
			position:relative;
			}
	#left{
			width:200px;
			height:500px;
			background:yellow;
			position:absolute;
			top:0;
			left:0;
			}
	#right{
			width:700px;
			height:500px;
			background:red;
			top:0;
			right:0;
		}
			<!--相对定位,根据需要选择,但是这里不用top left 一样 -->
</style>

</head>
<body>
<div  class="wrap">
<aside id="left"> #left</aside>
<section id="right">#right</section>
</div>
</body>
</html>






<!--第三种实现方案-->

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值