2012-02-17 16 views
0

これで困ったタイトルの質問は多分簡単だろうか?CSSボーダーが表示されない

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html> 
<head> 
<style> 
#home_1 { width:920px; height:50px; float:left; border:1px solid black; } 

.left_home1 { float: left; width: 33%; text-align: center; } 

.mid_home1 { float: left; width: 34%; text-align: center; } 

.right_home1 { float: left; width: 33%; text-align: center; } 
</style> 
</head> 
<body> 

<div id="home1"> 

       <div class="left_home1"> 

        left 

       </div> 

       <div class="mid_home1"> 

        middle 

       </div> 

       <div class="right_home1"> 

        right 

       </div> 

</div><!-- close home1 --> 
</body> 
</html> 
+3

'style'タグで'#home1'にする必要があります。 –

+0

ありがとうございます - 時にはあなたはあまりにも遠くになることがあります! –

+0

@SagarPatil:なぜあなたは答えでこれを言っていないのですか?それは実際には答えです... – awe

答えて

0

が最後</div>

+0

属性は 'clear'ではない' clean' –

+0

また、HTMLの 'clear'属性の値は' both'ではなく 'all'です。 – BoltClock

+0

@BoltClock: 'clear'の値は' both'になる可能性があります –

1

<br clear="all" />を置くとして正しく指摘:

をそれはスタイルタグに#のHOME1でなければなりません。 - @Sagar Patil

私の悪い!

0

あなたのCSSでは、あなたのCSSセレクタを変更するだけです。#home_1#home1に変更しても問題ありません。

関連する問題