• 締切済み

コメント欄全体を枠で囲み各記事ごとにコメント番号をつける方法

FC2ブログのテンプレート工房 http://10plate.blog44.fc2.com/ 上記サイトのライトフレームを使っているのですが 各記事ごとにコメントに番号をつけ、 コメント欄全体を枠で囲む 簡潔なカスタマイズ方法をお教えください HTML部 <!--comment_area--> <a name="comment_list"></a> <!--comment--> <div class="comment_outline"> <div class="comment_title"><a name="comment<%comment_no>" id="comment<%comment_no>"><%comment_title></a></div> <div class="comment_body"> <div class="comment_text"><%comment_body></div> <div class="comment_navi"> [ <%comment_year>/<%comment_month>/<%comment_day> <%comment_hour>:<%comment_minute> ] <SCRIPT LANGUAGE="JavaScript"> v = "<%comment_url>"; iffunc(v); function iffunc(b) { if (b) { document.write("<a href='<%comment_url>' target='_blank'>"+"<%comment_mail>"+"</a> <a href='<%comment_url>' target='_blank'><%comment_name></a>"); } else { document.write("<%comment_mail> <%comment_name>"); } } </SCRIPT> [ <a href="<%comment_edit_link>" title="コメントを編集">編集</a> ] </div><!--/comment_navi--> </div><!--/commnet_body--> </div><!--/comment_outline--> <!--comment--> シート部 .comment_outline { border:#000000 2px solid; background-color:#FFFFFF; text-align:left; margin-bottom:20px; } .comment_title { font-size:10pt; color:#ffffff; font-weight:bold; background-color:#000000; text-align:left; border-bottom:#666666 1px solid; padding:5px 20px; } .comment_body { font-size:10pt; color:#000000; border-top:#cccccc 1px solid; } .comment_text { text-align:left; margin:10px 20px; } .comment_navi { text-align:right; margin:0px 10px 3px; } 現状の上記のHTMLでは各コメントが2pixの枠で囲まれ 「タイトル」 本文 (右寄せ)投稿日時投稿者[編集] となります。 これを改変して 各コメントでなくコメント欄全体を枠で囲み (左寄せ)コメント番号Titled by「タイトル」投稿者投稿日時[編集] 本文 と変更したいです 知識不足ゆえの質問ではございますが お分かりの方がいらっしゃったらお答えしていただけると幸いです どうかよろしくお願いましす

  • HTML
  • 回答数1
  • ありがとう数3

みんなの回答

  • lesstia
  • ベストアンサー率45% (44/96)
回答No.1

各コメント枠は .comment_outline の border:#000000 2px solid; の部分を修正(というか削除) コメント欄全体を囲むには <!--comment_area--> のさらに外側にdivを作って囲み、そのCSSに上記borderを設定してあげればよいかと思います。 コメントのレイアウトは<div class="comment_navi">内のものを<div class="comment_title">内に移動すればよいでしょう。

a_krycek
質問者

お礼

ありがとうございます しかし、<!--comment_area--> のさらに外側にdivを作って囲み、そのCSSに上記borderを設定すると最初のコメントのみが枠で囲まれ残りのコメントに枠がなくなってしまいます どうすればよいものでしょうか・・・

関連するQ&A

  • CSSを動的出力部分で対応させたい

    以下のようなソースで、動的に出力されるコンテンツのレイアウトに対応したいと思っています。 "Cat_StyleP_img_1"、"name_"、"comment_"のクラス指定したDIVエリアは動的に出力される部分です。 --CSS-- div.mainframe_ { float: right; display: inline; overflow: hidden; } div.container_ div.contents_, div.container_ div.mainframe_ { width: 700px; } div.CategoryStyleP_ { width:100%; overflow: hidden; padding-bottom: 20px; } div.CategoryStyleP_Line_ { width: 102%; overflow: hidden; padding: 10px 0 10px 10px; margin-bottom: 10px; } div.CategoryStyleP_Item_ { float: left; display: inline; width: 340px; margin-right: 10px; padding: 10px 0; overflow: hidden; background: #fff; } div.CategoryStyleP_Item_ .Cat_StyleP_img_ { float: left; display: inline; width: 140px; } div.CategoryStyleP_Item_ .Cat_StyleP_main_ { float: left; display: inline; width: 180px; padding-right: 10px; } div.CategoryStyleP_Item_ h3.name_ { padding-bottom: 5px; margin-bottom: 10px; border-bottom: 1px solid #cfcfcf; font-size: 14px; font-weight: bold; } div.CategoryStyleP_Item_ div.comment_ img { margin: 0 0 10px 0; } --html-- <body > <div class="container_"> <div class="contents_"> <div class="mainframe_"> <div class="CategoryStyleP_"> <div class="CategoryStyleP_Line_ heightLineParent"> <div class="CategoryStyleP_Item_"> <div class="Cat_StyleP_img_"> <a href="#"><img src="img/usr/cat-sample.png" alt="動的出力画像1"></a> </div> <div class="Cat_StyleP_main_"> <h3 class="name_"> <a class="category_name_" href="#">タイトルA</a> </h3> <div class="comment_">コメントです。ここにはコメントが入ります。コメント、コメント。 </div> </div> </div> <div class="CategoryStyleP_Item_"> <div class="Cat_StyleP_img_"> <a href="#"><img src="img/usr/cat-sample.png" alt="動的出力画像2"></a> </div> <div class="Cat_StyleP_main_"> <h3 class="name_"> <a class="category_name_" href="#">タイトルB</a> </h3> <div class="comment_">コメントです。ここにはコメントが入ります。コメント、コメント。 コメント、コメント。</div> <span class="comment_">コメント、コメント。</span><span class="comment_">コメント、コメント。</span><span class="comment_">コメント、コメント。</span></div> </div> </div> </div> </div> </div> </div> </body> このレイアウトで出力する画像が無かった場合、"Cat_StyleP_img_1"のDIV自体が出力されない 仕様なのですが、画像の出力がない場合に、その他2つ("name_"、"comment_")の要素を横に広げて、 画像の出力が無かった場合の空きスペースが埋まるようにしたいのですが、何か良い方法はありませんでしょうか? JavaScriptではなくCSSで何とか対応したいと考えています。 お助け下さい、何卒宜しくお願いします。

    • 締切済み
    • CSS
  • 背景色を入れたいのですがよろしくお願いいたします。

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="author" content="xxxxxxxx" /> <meta name="keywords" content="xxxxxxxx" /> <title>xxxxxxxx </title> <link ref="stylesheet" type="text/css" href="cut.css" /> <style type="text/css"> body {margin: 0px 5em; } #container { width:800px; margin-left:auto; margin-right:auto; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #999; border-bottom: 1px solid #999; border-color:#000000; } #header {background-color:#ffffff;}←ここの色を黒に変えたいのですが変わりません。                        どうすればいいのでしょうか?  h1 { margin-left:20px; color:#ffffff; font-size:1.25em; padding-top:30px;}   ul {list-style-type:none; margin-left:100px; padding-left:0px;} li {display:inline; padding-right:20px; font-size:1.0em;} li a {text-decoration:none; line-height:2.2 } a { color:#000000} a:hover {color:#990000; } address a:hover {color:#990000;} p { font-size:1.25em; margin-left:50px; color:#ffffff;} .isu {text-align:right; margin-right:2px; } .moji {font-size:2em; line-height:200%; } .name { color:#ffff99; text-align:right; margin-right:50px; margin-bottom:50px; text-align:bottom;} .champ {text-indent:1em; font-size:2em;} .midasi { color:#ffff99; text-align:bottom; margin-left:100px; } .coment { color:#000000; text-align:left; margin-left:150px; line-height:2em; width:600px;} .http {font-size:0.9em; color:#000000; text-align:right; margin-right:0px; line-height:2em; padding-right:30px;} .denwa {color:#000000; text-align:right; line-height:2em; padding-right:30px;} hr {background-color:#000000; height:2px; width:250px; align-right;} .addless {text-align:right; color:#000000; padding-right:30px;} </style> </herd> <body> <div id="container"> <div id="header">←ここから <h1>xxxxxxxx </h1> <p class="isu"><img src="isuA.jpg" alt="xxxxxxxx" align="right" width="400px" height="250px" /> <br /> <p class="moji" >xxxxxxxx</p> <p class="champ">xxxxxxxx</p> <p class="midasi">xxxxxxxx</p> <p class="name">xxxxxxxx</p> <br /clear="all"></p> <br /> </div>←ここまでの背景色を黒に変えたいのですが変わりません。                        どうすればいいのでしょうか?  <br /> <br /> <p class="http">xxxxxxxx</p> <p class="addless">xxxxxxxx</p> <hr width="250" size="10" align="right"> <p class="denwa"> (黒電話) xxxxxxxx</p> <ul> <li><a href="top.html">トップページ</a></li> <li><a href="profile.html">プロフィール</a></li> <li><a href="staff.html">スタッフ</a></li> <li><a href="ryoukin.html">メニュー・マップ</a></li> <li><a href="mail.html">お客様メール</a></li> </ul> <br /> <br /> <p class="coment">xxxxxxxxxxxxxxxxxxxxxxxx</p>  <br /> <br /> <br /> <address>Copyright(C)<a href="mailto:saitou@gmail.com">Hair Salon Saitou</address> </div> </body> </html>

  • floatとclearを使ったレイアウト作成について

    http://www.ario-nishiarai.jp/ 上記のサイトのようなページ中央より下のレイアウトを作りたいと思い、下記のようにコーディングしました。 <html> <head> <title>Web</title> <style type="text/css"> .container {text-align:left;width:760px;margin:0px auto;background-color:#FFFFFF;} .content1 {width:760px; height:200; padding:0px; border:1px solid #999999;} .content2 {width:760px;padding:0px;border-right:1px solid #999999; border-bottom:1px solid #999999; border-left:1px solid #999999; margin:0;} .box1 {width:180px; float:left; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px;} .box2 {width:180px; float:left; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px;} .box3 {width:180px; float:left; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px;} .box4 {width:180px; float:left; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px; margin-bottom:10px;} .box5 {width:220px; float:right; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px;} .box6 {width:220px; float:right; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px;} .news {width:350px; height:200; overflow:auto; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px;} .topics {width:350px; height:200; overflow:auto; border-top:1px solid #CCCCCC; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; margin-top:5px; margin-left:5px;}solid #CCCCCC; margin-top:5px; margin-left:5px;} </style> </head> <body> <div class="container"> <div class="content1"> 画像 </div> <div class="content2"> <!--左側--> <div class="box1"> タイトル<br /> メニュー </div> <div class="box2"> タイトル<br /> メニュー </div> <div class="box3"> タイトル<br /> メニュー </div> <div class="box4"> タイトル<br /> メニュー </div> <!--中央--> <div class="news"> あ </div> <div class="topics"> い </div> <!--右側--> <div class="box5"> う </div> <div class="box6"> え </div> </div> </div> </body> </html> box1、box2、box3、box4のボックスは左側に、news、topicsのボックスは中央に、box5、box6のボックスは右側にレイアウトしたいと思っています。 floatとclearを使って作成するのだと思うのですが、どうコーディングしたら良いのかわかりません。 どこをどう直したら良いかアドバイスいただけますようお願いします。

    • ベストアンサー
    • HTML
  • cssで、全体を中央寄せ、文字は左寄せにする方法

    CSSで、全体を中央寄せにしつつ、全ての文字を左寄せにする方法を教えてください。 bodyにtext-align: centerを設定し、 #outline{ width:1200px; margin-right:auto; margin-left:auto; text-align:left; } .content{ float:left; width: 1200px; } と書き、<div id="outline"><div class="content">で全体を囲みました。 すると、大方できたのですが、h要素のみずれてしまいます。 (h1は全体に対する左寄せ、h2は全体に対する中央寄せとなってしまいました・・・) h要素は色とフォントサイズを指定したのみです。 CSSについて自体あまり詳しくないので、なぜこうなってしまっているのかわかりません。 どのようにすれば、他と同じく中央左寄せにすることができるでしょうか? よろしくお願いいたします。

    • ベストアンサー
    • CSS
  • CSS 背景が表示されない、IEでflotが適用されない

    dlタグで3×3のカラムで表示を行いたいのですが上手くいかず困っています。 dlに指定したfloat:left;がFierfox3では適用され横並びにddの内容が表示されるのに対し、EI6ではfloat:left;が適用されず縦並びになってしまいます。 そしてファイルをサーバーにUPした所、文字自体に文字化けも起こります。 背景にいたっては、EI・Fierfox共に表示されず。 と、目も当てられない状態です。 そこで、試しに別のサーバーにファイルをUPした所、float:left;はIEでも問題なく適用され、文字化けも解消されました。 ただ、背景だけは表示されないままでした。 別サーバーにUPした事でIEのfloatが適用され、文字化けも解消たという事は、サーバー固有の設定等に対応していないファイルをUPしてしまっていたと言う事なのでしょうか?それともCSSに問題があるのでしょうか? 背景は何故表示の理由等も含めて、どなたかお分かりの方がいらっしゃいましたらよろしくお願い致します。 -html-------------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="ja"> <head> <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=Shift_JIS"> <link href="index.css" rel="stylesheet" type="text/css" /> <title>タイトル</title> </head> <body> <div align="center"> <div id="top_box"> <dl> <dt class="name">タイトル</dd> <dd class="comment">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</dd> <dd class="data">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</dd> </dl> <dl> <dt class="name">タイトル</dd> <dd class="comment">テキストストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスキストテキストテキスト</dd> <dd class="data">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</dd> </dl> <dl> <dt class="name">タイトル</dd> <dd class="comment">テキストストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスキストテキストテキスト </dd> <dd class="data">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</dd> </dl> </div> </div> </body> </html> --css------------------------------------------------ /* CSS Document */ body { font-size:small; font-family: "Verdana", "ヒラギノ角ゴ Pro W3", "MS ゴシック", "Osaka‐等幅"; color:333; background-position: center; background-image:url(images/back.gif); background:#FFF; text-align: center; text-indent: 0px; padding: 0px; margin: 30 0 0 0; } #contents { margin: 0px auto; width: 870px; } form { margin: 0px; padding: 0px; } div { margin: 0px; padding: 0px; font-size:0.9em; color:#666666; letter-spacing:0.08em; line-height:1.4em; } img { border: 0px; } .box { width:745px; text-align:left; } .title { width:870px; text-align:left; } #top_box{ width:800px; height:400px; background-color:#ffffff; } /*font-sizeは固定*/ dl{ margin:0px; margin-left:10px; margin-right:10px; margin-bottom:1em; padding:0px; float:left; width:225px; font-size:12px; border-width:1px 1px 0px; border-style:solid; border-color:#ffffff; } dt{ margin:0px; padding:0px; } dd{ margin:0px; padding:4px 0.5em; border-color::#fff; border-bottom:0px solid; text-align:left; } dd.name{ height:3.0em; } dd.comment{ height:3.0em; background-color:#ffffff; } dd.date{ height:3.0em; border-style:none; }

  • fixedで作ったフロートメニューを中央に配置するには

    浮かせたaをbの位置に表示させたいのですが、aは左上に固定されてしまいます。 IE7では上手くいくのですが、FF3では思うように行きません。 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>TEST</title> <style> html,body{margin:0;padding:0;width:100%;height:100%;} </style> </head> <body> <div style="max-width:780px;width:100%;margin:0px auto;text-align:center;border:solid 1px #AAAAFF;color:#AAAAFF;position:fixed;">a</div> <div style="max-width:780px;width:100%;margin:0px auto;text-align:center;border:solid 1px #FFAAAA;color:#FFAAAA;">b</div> </body> </html>

  • テーブルの隙間について

    WEBのデザインを、本を読みつつ学んでいるのですが テーブルに関して疑問があるので、質問させていただきます。 【cssの中身】 /* ヘッダー */ .head { background-color:#ccc; width:100%; height:70px; margin-left:auto; margin-right:auto; } .head h1 { font-size:14px; font-family:Verdana,Osaka,MS UI Gothic,; color:#000; margin-bottom:2px; } .head td{ vertical-align:middle; } .head1 { width:40px; text-align:right; } .head2 { text-align:left; padding-right: 4px; } .date{ font-size: 12px; color: #666; font-family : Verdana,Osaka,"MS UI Gothic",serif; } /* メニュー */ .menu1 div{ float: left; } .menu{ width: 100%; background-color: #666; font-size: 12px; font-weight: bold; border-top: solid 1px white; } .menu1 div{ width: 80px; border-right: solid 1px white; text-align: center; padding-top: 5px; padding-bottom: 5px; } .menu2{ text-align: right; } .menu2 div{ margin-right: 10px; color: #fff; } .menu1 a{ color: #999; text-decoration: none; } .menu1 a:hover{ color: #fff; } 【ページの中身】 <a name="top"> <table class="head" cellspacing="0"> <tr> <td class="head1"> <img src="icon.jpg" border="0" alt="*" width="35" height="36"> </td> <td class="head2"> <h1>********</h1> </td> </tr> </table> </a> <table class="menu" cellspacing="0"> <tr> <td class="menu1"> <div><a href="link.html">Test</a></div> <div><a href="link.html">Test</a></div> <div><a href="link.html">Test</a></div> <div><a href="link.html">Test</a></div> <div><a href="link.html">Test</a></div> </td> <td class="menu2"> <div>Last update:00.00</div> </td> </table> このような形で、ヘッダーとメニューを作っているのですが、メニューの線とヘッダーとの間に1pxほどの隙間(白い部分)が出来てしまいます。これをなくすことはできないのでしょうか?メニュー部分のテーブルに cellspacing="0"を入れると隙間が無くなると本に書いていたのですが、ほんの少しだけ隙間が残ってしまいます。 宜しくお願いします。

    • ベストアンサー
    • HTML
  • 直接書き込むCSSを外部ファイルに設定したい

    CSS初心者です。下記の携帯テンプレートを使ってサイトを作りたいです。 タグに直接書き込むタイプのCSSが多いのですが、 このソースの一部を外部ファイルに設定するには、どういう書き方をしたら良いでしょうか? 【外部に設定したい項目】 ★タイトル下線のMARGIN-RIGHT: 47% ★真ん中の線(画像位置)BACKGROUND-POSITION: 53% ★一番下線のMARGIN-LEFT: 53%; 外部にしたい理由は携帯とパソコンで見た時にそれぞれ線の位置を変えたいと思って いるからです。出来ますでしょうか?CSSに詳しい方、どうかお願いします(>_<) 【全タグ】 <html> <HEAD> <TITLE>TITLE</TITLE> </HEAD> タイトル <H1 style="PADDING-LEFT: 7px; MARGIN: 0px; PADDING-TOP: 10px; BACKGROUND-COLOR: #ffffff"></H1> <DIV style="BACKGROUND-POSITION: 53% 40%; BACKGROUND-IMAGE: url(http://deai.mokuren.ne.jp/up/src/up3891.gif); BACKGROUND-REPEAT: repeat-y"> <DIV style="BORDER-TOP: #000000 1px solid; MARGIN-RIGHT: 47%"> <P style="PADDING-RIGHT: 0px; PADDING-LEFT: 15px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 7px"></P></DIV> <DIV style="MARGIN-LEFT: 40%; PADDING-TOP: 17px"> <DIV style="WIDTH: 300px; MARGIN-RIGHT: 20px"> <H2 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 13px; PADDING-BOTTOM: 2px; MARGIN: 0px 0px 3px; PADDING-TOP: 3px; BACKGROUND-COLOR: #000000"> <font color="#ffffff">コンテンツ</font></H2></font> <div style="border:solid 1px #000000;margin-bottom:5px; padding:5px;background-color:#ffffff;"><Font Color="#000000"><A Href="">小説</a></div> <div style="border:solid 1px #000000;margin-bottom:5px; padding:5px;background-color:#ffffff;"><Font Color="#000000"><A Href="">小説2</a></div> <div style="border:solid 1px #000000;margin-bottom:5px; padding:5px;background-color:#ffffff;"><Font Color="#000000"><A Href="">その他</a></div> </DIV></DIV> <DIV style="MARGIN-LEFT: 53%; BORDER-BOTTOM: #000000 1px solid"> <P style="PADDING-RIGHT: 5px; MARGIN: 0px; PADDING-TOP: 17px" align=right></DIV></DIV> <P style="PADDING-RIGHT: 5px; PADDING-LEFT: 0px; PADDING-BOTTOM: 10px; MARGIN: 0px; PADDING-TOP: 5px" align=right> </HTML>

    • 締切済み
    • CSS
  • 4枚の画像を均等間隔で一列に並べる

    4枚の画像を一列に並べようと思います。 4枚に与えられたスペースは550pxです。画像の下のコンテンツも550pxを基準に配置するので、4枚のうちの両側の2枚は550pxの両端に配置しようと思います。 この趣旨でコーディングしたのが下記URLです。 http://makoji.web.fc2.com/test/test_18/test.html 他の画像を margin-right: 14px; とすると綺麗に並びました。ただ確認をとったのは最近のブラウザだけで、古いブラウザでどうなっているのか分かりません。過去の例でうまく並んだと思ったらIE6.0で4枚目が2列目に改行されてしまっていたことがあります。 そこでmarginをブラウザに自動割り振りさせることが出来ないものかと思案するのですが・・・ とりあえず右端の画像を右端に寄せるために margin-right: 0px; margin-left: auto; としてみましたがダメでした。でも width: 125px; もしくは float: right; を挿入すれば解決できます。 しかしながら真ん中の2枚をどうすれば均等に配置できるかが分かりません。 この場合、古いブラウザを試せる環境を全部揃えて片っ端からチェックを入れるしかないのでしょうか。 -------------------------------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <style type="text/css"> <!-- * { font-size: 14px; font-wight: 100; color: #000000; } .wrap { margin: 0px auto; width: 700px; } .logo { border: solid 1px #FF0099; } .main { padding-top: 15px; padding-bottom: 15px; border: solid 1px #FF0099; } .main img { margin-right: 2px; float:left; display: block; } .menu { float: left; margin-top: 0px; margin-left: 10px; padding-left: 0px; } .menu li { margin-bottom: 2px; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; width: 100px; list-style-type: none; background-color: #FFCCFF; } .list span { color: #FF0099; } .menu a:link { color: #FF0099; } .menu a:visited { color: #FF0099; } .menu a:active { color: #FF0099; } .menu a:hover { color: #FF0099; } .clear { clear: both; } /* インデックス */ .index_body { margin-top: 15px; padding-left: 133px; } .sample { margin-bottom: 10px; width: 550px; text-align:center; background-color: yellow; } .sample a { text-decoration: none; } .sample img { border: solid 1px #FF0099; float: none; } .sample .left { float: left; margin: auto auto auto 0px; text-align: center; } .sample .middle { float: left; margin: auto; text-align: center; } .sample .right { margin-right: 0px; margin-left: auto; text-align: center; } --> </style> </head> <body> <div class="wrap"> <div class="logo"> <img src="dot_999999.gif" width="698" height="120"> </div><!-- end of "logo"--> <div class="main"> <ul class="menu"> <li>ああ</li> </ul><!-- end of menu --> <div class="index_body"> <div class="sample"> <div class="left"> <img src="dot_999999.gif" width="123" height="170" alt="ああああ"> <div>aaaaa</div> </div><!-- end of "left" --> <div class="middle"> <img src="dot_999999.gif" width="123" height="170" alt="ああああ"> <div>aaaaa</div> </div><!-- end of 1of"middle" --> <div class="middle"> <img src="dot_999999.gif" width="123" height="170" alt="ああああ"> <div>aaaaa</div> </div><!-- end of 2of"middle" --> <div class="right"> <img src="dot_999999.gif" width="123" height="170" alt="ああああ"> <div>aaaaa</div> </div><!-- end of "right" --> </div><!-- end of "sample" --> <div><img src="dot_999999.gif" width="550" height="450" alt="" /></div> <div class="clear"></div> </div><!-- end of "index_body" --> </div><!-- end of "main" --> </div><!-- end of "wrap" --> </body> </html>

  • ホームページビルダーでスタイルシートを使ったのですが?

    今、ホームページビルダーで簡単な2カラム(右メニュー)のテンプレートを作っています。 質問ですが、メニューバー(サイドバー)に色を付けたくて、画像を使う事にしました。 <div class="main">に画像(background.gif)を入れ属性で繰り返す(垂直方向)にチェックをいれたのですが、IEやfirefoxでプレビューでは反映されていないです。 色々いじってみたのですがどうしても解りません。どこが間違っているのか教えていただけないでしょうか? よろしくお願いします。 HTML <body> <div class="box"> <div class="header"> <span class="site_name">ここにサイト名を入れる</span> <h1>ここにh1</h1> <div class="description_1">ここに簡単な説明文</div> </div> <div class="main"> <div class="contents">コンテンツ部分<br /> </div> <div class="menu"> メニュー部分 </div> </div> <div class="footer"> フッター部分 </div> </div> </body> スタイルシート * { margin:0; padding:0; } .box{ width : 750px; margin: 0 auto; border-left-width : 1px; border-left-style : solid; border-left-color : black; border-right-width : 1px; border-right-style : solid; border-right-color : black; border-bottom-width : 1px; border-bottom-style : solid; border-bottom-color : black; } .header { width : 726px; height : 96px; background-color : #b9b9ff; padding-top : 12px; padding-left : 12px; padding-right : 12px; padding-bottom : 12px; border-bottom-width : 2px; border-bottom-style : solid; border-bottom-color : black; } .main { width : 750px; background-image : url(file:///C:/Documents and Settings/※※※/img/background.gif); background-repeat : repeat-y; background-position : 0px 0px; margin-top : 0px; margin-bottom : 0px; margin-left : auto; margin-right : auto; background-color : #ffffff; } .menu { float: left; width : 180px; padding-top : 10px; padding-left : 10px; padding-right : 10px; padding-bottom : 10px; margin-left : auto; margin-right : auto; } .contents { float: left; width : 526px; padding-top : 12px; padding-left : 12px; padding-right : 12px; padding-bottom : 12px; } .footer { clear: both; width : 726px; height : 26px; background-color : #b9b9ff; padding-top : 12px; padding-left : 12px; padding-right : 12px; padding-bottom : 12px; text-align : center; } .menu ul { list-style: none; } .site_name{ font-size : 21px; font-weight : bold; margin-left : 12px; } h1{ font-size : 15px; margin-top : 12px; margin-left : 24px; } .description_1{ font-size : 12px; font-weight : normal; margin-left : 24px; }

専門家に質問してみよう