• 締切済み

HTML 構文

HTMLについての質問です。 勉強を始めたばかりですので、至らぬ点はご容赦いただければ幸いでございます。 以下が正解コードの一部です。 .xxx-image { float: left; height: 180px; } .xxx-text-headline { padding-bottom: 15px; } .xxx-text { float: left; padding: 30px 0 0 25px; } .xxx-date { display: inline-block; font-size: 12px; } ーーーーー以下が私が間違えたコードです。 .xxx-image { float: left; height: 180px; } .xxx-text-headline { padding-bottom: 15px; } .xxx-text { float: left; padding: 30px 0 0 25px; } .xxx-date { font-size: 12px; ←間違い箇所 display: inline-block; } ここの順番を間違えただけで、本来ならば画像と文字を一定間隔あけたかったものが、くっついてしましました。 各順番は大切ですか? よろしくお願いいたいます。

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

みんなの回答

  • ngwaver
  • ベストアンサー率26% (323/1202)
回答No.1

HTMLではなくCSSですね。 「.xxx-date」の「font-size: 12px;」と「display: inline-block;」の順番を変えても表示結果は変わらないので、別の場所が違っていたのではないでしょうか。

関連するQ&A

  • IE6でfloatされない。

    IE6でfloatされない。 横幅950pxのコンテンツの中に divで3つのboxを作って横一列に並べているのですが ie7,8, firefoxでは意図した通りに表示されますがie6ではdiv id="c"(下記ソース)がfloatされません、どなたか解決策をご指導お願いします。 <div id="a"><img src="img/left.png" width="403" height="240" alt="スペース左" title="" /></div> <div id="b"><iframe name="iframe3" id="iframe3" frameborder="0" scrolling="no" src="home.html" title="******">*******</iframe></div> <div id="c"><img src="img/right.png" width="403" height="240" alt="スペース右" title="" /></div> css記述は下記の通りです #a{ padding-top : 0px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; width : 403px; height : 240px; float : left; display : inline; } #b{ padding-top : 0px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; width : 144px; height : 240px; float : left; display : inline; } #c{ padding-top : 0px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; width : 403px; height : 240px; float : left; display : inline; } #iframe3{ border-width : 0px 0px 0px 0px; margin-left : 0px; width : 144px; height : 240px; padding-top : 0px; overflow : hidden; margin-top : 0px; margin-right : 0px; margin-bottom : 0px; padding-bottom : 0px; padding-left : 0px; padding-right : 0px; } 宜しくお願いします。

  • CSSでレイアウトが崩れます

    CSSに挑戦したのですが、IE6.0とie7.0で若干表示がくります。 ただ、IEでは何とか表示します。 また、MAC IE5.2では、右側メインが左メニューの下に崩れて表示されてしまいます。 ドリームウィーバーでもやはり表示が崩れるのです。 cssは以下になります。 左と右のレイアウトに問題があるのでしょうか。一部省略しました。 #Wrapper { padding: 0px; width: 800px; display: block; margin: 0px; background: url(../images/bg_img_01.jpg) repeat-y bottom; height: auto; } body { margin: 0px; padding: 0px; text-align: center; color: #333333; font-size: 12px; line-height: 150%; vertical-align: middle; } #imgR { padding: 0px; float: left; width: 500px; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; } #arrow { margin: 0px; padding: 0px; float: left; width: 500px; } #rContents { text-align: left; padding: 0px; margin-top: 30px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #111184; } .TextRink { text-decoration: none; color: #FF6600; display: inline; margin: 0px; padding: 0px 0px 0px 5px; } #WrapperL { margin: 0px; padding: 0px; width: 215px; height: auto; float: left; } #WrapperR { padding: 0px; width: 563px; height: auto; margin-top: 0px; margin-right: 15px; margin-bottom: 0px; margin-left: 0px; } #Footer { padding: 0px; height: 52px; width: 563px; background-image: url(../images/footer.gif); background-repeat: no-repeat; display: block; float: left; background-position: bottom; margin: 50px 0px 0px; vertical-align: bottom; } .sabu-title { padding: 13px 0px 0px; } .underline1 { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCCCCC; } #Header { display: block; margin: 0px; padding: 0px; height: 147px; width: 563px; background-image: url(../images/header_img.jpg); background-repeat: no-repeat; } .HeaderText { color: #FFFFFF; padding-top: 3px; margin: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 150px; font-size: 10px; }

  • DreamweaverMXのデザインビューが一部表示されなくなる

    DreamweaverMXのデザインビューが一部表示されなくなってしまい困っています。 どうして表示されなくなったのか具体的に言うと、 3カラムのレイアウトをdivを使いCSSで作成していました。firefoxで見るとフッターがメインコンテンツの上部にきてしまっていたので、高さを指定してあった「右メニュー」や「左メニュー」、また「メインコンテンツ」の部分のdivの高さをすべて「auto」にし、フッター部分のCSSに「clear: both;」を記入し、修正を図りました。 これでその問題は解決されましたが、その後、DreamweaverMXのデザインビューの一部(メインコンテンツ、3カラムの真ん中部分です。)が途中から真っ白になってしまっていて、そこに書かれていたテキストや画像等すべて真っ白で、デザインビューで作業できなくなってしまいました。 真っ白でも、その部分に書いたテキストはマウスで反転させたりすると黒くその部分が反転するので、テキスト等はそこにあるようですが、真っ白ですから、作業ができません。 コードビューで作業できますが、それではDreamweaverMXを使う意味がありません。デザインビューで作業できれば、非常にスピーディーに出来るので、こうなってしまい非常に困っています。 「すべてのビジュアルエイドを非表示」にしたら直ったこともあり、そうして見ましたが、今回は駄目です。 CSSコードの書き方に問題があるかもしれません。 以下が、そのCSSコードです。 /* container */ #container { width: 900px; margin-right: auto; margin-left: auto; text-align: left; height: auto; } #incontainer { width: 700px; float: left; height: auto; } /* メイン */ #main { float: right; width: 480px; padding: 10px; height: auto; } /* 左メニュー */ #ml { float: left; width: 200px; height: auto; } #box-ml { padding: 0px 0px 10px; width: 200px; float: left; height: auto; } #ul-ml { margin: 0px; padding: 0px; display: inline; text-indent: 0px; list-style-type: none; text-align: left; } #li-ml-kg { margin: 0px; list-style-type: none; padding: 0px; display: block; line-height: 26px; background-image: none; text-indent: 20px; background-color: #66CC00; border: 1px solid #CCCCCC; color: #FFFFFF; font-size: 13px; } #li-ml a { margin: 0px; list-style-type: none; padding: 0px; display: block; line-height: 25px; background-image: url(buttons/li-bg.gif); text-indent: 20px; font-size: 13px; } #li-ml a:hover { margin: 0px; list-style-type: none; padding: 0px; display: block; line-height: 25px; background-image: url(buttons/li-bg-m.gif); text-indent: 20px; color: #FF0000; font-size: 13px; } /* 右メニュー */ #mr { width: 200px; float: right; text-align: left; height: auto; } #box-pick { width: 180px; padding: 10px; border: 1px solid #CCCCCC; margin: 0px 0px 5px; display: block; float: right; height: auto; } #box-koshin { display: block; width: 180px; padding: 10px; border: 1px solid #CCCCCC; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; float: right; height: auto; } #box-saishin { display: block; width: 180px; border: 1px solid #CCCCCC; padding: 10px; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; float: right; height: auto; } #box-toiawase { display: block; width: 180px; border: 1px solid #CCCCCC; padding: 10px; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; float: right; height: auto; } #box-counter { display: block; width: 180px; padding: 10px; text-align: center; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; float: right; height: auto; } /* フッター */ #footer { background-color: #66CC00; height: 50px; width: 900px; margin-right: auto; margin-left: auto; color: #FFFFFF; padding-top: 18px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;     clear: both; } 何が原因なんでしょうか? 宜しくお願いいたします!

    • ベストアンサー
    • CSS
  • JavaScript

    自分は、初心者です。 クリックを押すと、右に文字を動かしなさいと言う問題が出ました。 CSSのデーターも渡されています。 どのように、プグラミングしたらよろしいでしょうか? よろしくお願いします。 cssのデーターです。 ===================== *{ font-family: arial,helvetica,sans-serif; } .odd{ margin: 0px auto; padding: 10px; background: #333; color: #FF0; } .even{ margin: 0px auto; padding: 10px; background: #999; color: #00F } h1{ margin: inherit auto; text-align: center; } #source{ float: left; width: 45%; height: 100%; display: inline-block; border: 1px solid red; } #destination{ float: right; width: 45%; height: 100%; display: inline-block; border: 1px solid blue; } .wrapper{ height: 800px; } #buttonForm{ font-size: 20px; text-align: center; display: block; margin: 0px auto 20px; } #button{ padding: 10px 15px; font-size: 20px; } =================

  • IEだとdivが横に並びません

    CSSでレイアウトをしているのですが、横にふたつdivを並べたいのに、右側のdivが下にまわってしまいます。 http://oshiete1.goo.ne.jp/qa3576983.html こちらでIEでは左の余白が倍になってしまうと知り、display:inlineを指定しましたが、解決しません。 何が原因でしょうか。 HTML: <div id="main"> <div id="mainl"> </div> <div id="mainr"> </div> </div> CSS: #main { width: 900px; } #mainl { float: left; height: 317px; width: 324px; display: inline; padding-top: 26px; padding-right: 16px; padding-bottom: 0px; padding-left: 40px; } #mainr { float: right; height: 317px; width: 480px; padding-top: 26px; padding-right: 40px; }

    • 締切済み
    • CSS
  • xml宣言をするとIE6で右サイドがカラム落ちしてしまいます。

    http://www.infofx.jp/ 上記のサイトをアップしたばかりなのですが、 xml宣言をすると右サイドがカラム落ちしてしまいます。 SEOを考えてxml宣言は外したくないのですが、良い方法があればどなたか教えて頂けますでしょうか?宜しくお願い致します。ちなみに以下がcssです。 @charset "shift_jis"; body { color: #666666; margin: 0px; padding: 0px; text-align: center; font: 75%/1.8 "メイリオ", "MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; background: #e9f3ff url(images/kabe.gif) repeat-x top; } h1,h2,h3,p,ul,li{ margin: 0px; padding: 0px; } ul{ list-style-type: none; } img { border: none; vertical-align: bottom; } #container { background-image: url(images/container_bg.gif); width: 896px; text-align: left; background-repeat: repeat-y; background-position: center; margin-top: 0px; margin-right: auto; margin-left: auto; padding-right: 4px; padding-left: 4px; } *.float { float: left; margin-right: 1em; } /*コンテンツ ----------------------------------------------------------------*/ #contents { float: left; width: 706px; } /*メイン ----------------------------------------------------------------*/ #main { float: right; width: 498px; margin-right: 9px; margin-left: 9px; display: inline; } #main h2 { background-image: url(images/midashi_bg.gif); background-repeat: no-repeat; background-position: left top; font-size: 100%; padding-left: 10px; height: 30px; padding-top: 4px; padding-right: 5px; color: #FFFFFF; letter-spacing: 0.5em; } #main p { padding-right: 10px; padding-left: 10px; padding-bottom: 15px; } /*右側 ----------------------------------------------------------------*/ #side { float: right; width: 181px ; display: inline; margin-right: 4px; margin-left: 5px; font-size: 90%; text-align:center; } #side p { margin-bottom: 10px; color: #666666; } .side-table { border: 1px solid #cccccc; padding: 2px; line-height: 2; text-align: center; background: #f7faff; } .side-table h3 { background-color: #ffffff; padding-top: 3px; padding-bottom: 2px; color: #666666; text-align: center; font-weight: normal; font-size: 100%; letter-spacing: 0.5em; margin-bottom: 10px; border: 1px solid #cccccc; } /*メニュー他 ----------------------------------------------------------------*/ #sub { float: left; width: 181px; display: inline; margin-right: 5px; margin-left: 4px; color: #666666; } #sub li { background-image: url(images/menu_arrow.gif); background-repeat: no-repeat; background-position: left center; padding-left: 25px; } #sub ul { margin-bottom: 20px; } #sub li a { color: #666666; text-decoration: none; display: block; width: 100%; } #sub li a:hover { color: #FF3B33; } .arrow-last { background-image: url(images/menu_arrow_last.gif) !important; background-repeat: no-repeat; background-position: left center; } .menu-midashi { border: 1px solid #cccccc; background-image: none !important; background-color: #ffffff; color: #666666; padding-top: 3px; padding-bottom: 2px; } /*clearfix ------------------------------------------------------------------*/ #container:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } #container { display: inline-block; } /* Hides from IE-mac \*/ *html #container { height: 1%; } #container { display: block; } /* End hide from IE-mac */*/

    • 締切済み
    • XML
  • 【css】floatを指定するとはみ出します

    ブロック要素をfioatで横並びにした際に、画像とテキストが全体を囲っている要素(親要素)からはみ出すことが多々あります。 その度に高さを指定して回避しているのですが、こちらはその他に回避の方法というのはあるのでしょうか? それとも、自分の記述がおかしいのでしょうか? 例えば下記の例です。 こちらは左に画像、右にタイトルとコメントが入ります。 <div class="aaa"> <div class="left"><img src="photo.jpg" width="180" height="120"></div> <div class="right"> <h3 class="title">タイトルです</h3> <div class="comment">コメントです</div> </div> </div> //////////////////////////////////// .aaa{ margin-bottom: 5px; padding-top: 7px; padding-right: 10px; padding-bottom: 7px; padding-left: 10px; clear: both; } .left{ float: left; height: 120px; width: 180px; } .right{ float: left; padding-left: 10px; width: 380px; } .title{ font-size: 90%; line-height: 120%; padding-right: 10px; padding-left: 10px; width: 360px; padding-top: 3px; padding-bottom: 1px; clear: both; } .comment{ font-size: 80%; line-height: 120%; padding: 5px; clear: both; }

  • WordPressで画像に枠が入ってしまいます。

    wordpress でホームページを制作していますが、写真に枠線が入ってしまいます。どの部分を消したらいいのかがわかりません。有料テンプレートを買ってしまって特にわかりません。。。どなたかお助けください。 CSSは @charset "UTF-8"; /* CSS Document */ /* -------------------------------------------------- setting ----------------------------------------------------- */ body { background:#ededed url(images/bg/default.gif);} p { font-size: 110%; line-height:1.6em } li{list-style:none;} .row { width: 980px; } @media only screen and (max-width: 767px) { p { font-size: 115%; } } /* -------------------------------------------------- header ----------------------------------------------------- */ header.row { padding-top:23px; padding-bottom:20px; } header.row .nine.columns{ padding:0; } header h1 { margin:0; padding:7px 0 0 0; line-height:1em; font-size: 36px; color:#666; font-family:Georgia, "Times New Roman", Times, serif; font-weight:lighter; float:left; text-align:left; } header img{ border:none; } header h1 a { color:#666; text-decoration:none; } header h1 a:hover { color:#fff; } header #tagline { color:#333; font-size:small; float:left; line-height:37px; padding-top:7px; padding-left:15px; } header #contact { text-align:right; } header #contact #phone { font-weight:bold; font-size: large; color:#666; line-height:1em; } header #contact #phone a { color:#666; } header #contact #icon img { margin-left:5px; vertical-align:middle;} header h3 { margin:0; margin-bottom:5px; padding-left:7px; font-size:14px; } header .widget_RGBdesign_Contact#contact h3 { border-left:0px #FFFFFF solid; padding-left:0px; padding-bottom:5px; } header .widget_search#contact h3, header .widget_search#contact label { display:none; } header form, header p { margin:0; padding:0; } header .widget_search#contact #s {width:70%; float:left; margin:0; padding:0;} header .widget_search#contact #searchsubmit {width:30%: float:right; margin:0; padding:0; font-size: 20px; margin-top:0.3em;} header .widget ul li { display: inline; } header:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }

  • リスト内での画像の下部揃え

    下記のように、上部テキスト下部画像の組み合わせで、横並びでリストを作りました。 テキストの量に合わせて、画像が上下するので、見栄えが悪いです。それをテキストは そのままの位置で、画像は下部でそろえたいと思います。それが不可能な場合 せめてすべて下部で合わせたいです。 display: inline-block; vertical-align: bottom; を記入しましたが、全く効果ありません。 どうすればよろしいのでしょうか? HTML <body id="news" class="s"> <div > <ul class="u1" > <li><span class="time">テキスト</span> <div class="news_img"> <img src="hoge.jpg"> </li> </ul> </div> </body> CSS #news.s ul { padding: 10px; width: 100%; } #news.s li { float: left; width: 170px; height: 240px; padding:0 10px 8px 0; font-size: 12px; list-style: none; display:block; vertical-align: bottom; } #news.s li img { display: inline-block; vertical-align: bottom; border: solid 1px silver; width: 140px; height: 140px; max-width: 140px; max-height: 140px; } .news_img { display: table-cell; height: 160px; text-align: center; width: 160px; margin-top: 10px; } div.news_img div { /* IE 7 */ display: inline; zoom: 1; }

    • ベストアンサー
    • CSS
  • WordPress レスポンシブテーマのCSS

    http://atsumare.wp.xdomain.jp/ 上記のURLでWordPressを使ってレスポンシブデザインの自作テーマを構築中です。 クラス「glay」でくくったボックスがスマホだと本文に食い込んでしまって困っています。 下記のものがスマホ用スタイルシートです。 /**************************************** スマホ用 ****************************************/ @media screen and (max-width:640px){ #main-1 { max-width: 100%; width: 100%; } /* ページヘッダー */ body.home header { background-size:cover; background-image:url("http://atsumare.wp.xdomain.jp/wp-content/uploads/2019/09/bg.jpg"); width:100%; height:200px; } header img{ background-size:cover; display:inline-block; margin-left:auto; margin-right:auto; } h1 { position:absolute; top:0; left:0; margin-left:50px; margin-top:100px; color:#fff; font-size:24pt; } header img { background-size:cover; /* width:640px; height:200px; */ } .right-dw { display:inline-block; position:relative; width:100%; float:left; } header nav { display: none; } /* コンテンツエリア */ article { width:100%; display:block; padding-left: 5px; padding-right: 5px; box-sizing: border-box; } img { max-width:100%; height:auto; margin: 5px 5px 5px 5px; float:left; background-size:cover; } .right-dw { clear:both; display:block; position:relative; width:100%; height:auto; float:left; } .glay { border:dotted 2px #696969; display:block; color:#696969; padding:2px; margin:15px 15px 15px 15px; position:absolute; } /* フッターエリア */ footer { max-width:100%; width:500px; display:block; text-align:center; margin-left:auto; margin-right:auto; } .footer { width:130px; display:inline-block; text-align:left; color: #000; font-size: 10pt; margin-left:auto; margin-right:auto; } small { font-size:10pt; } } どなたかご教示ください。

    • 締切済み
    • CSS

専門家に質問してみよう