<h2></h2>の中に、サイズの違う文字を・・

このQ&Aのポイント
  • HTMLの<h2>タグ内に、サイズの異なる文字を表示したい場合、どのようにすればいいでしょうか?現在は、<h2>タグに<uline>クラスを指定していますが、この方法では文字サイズを変更することができません。
  • また、タイトルに日付を含めたい場合、<h2 class="uline">タイトル[date]</h2>とすると、[date]のフォントサイズが大きすぎて表示が崩れてしまいます。この日付をタイトルの右端に配置し、フォントサイズを12px(または85%)にする方法はありますか?
  • <h2 class="uline">タイトル</h2>[date]とすると、[date]の前で改行されてしまいます。一行でタイトルと日付を表示する方法はありますか?
回答を見る
  • ベストアンサー

<h2></h2>の中に、サイズの違う文字を・・

こんにちは。よろしくお願いします。 以下の様に、追加したいのですが、分かりません。 現在は、 <h2 class="uline">タイトル</h2> となっております。 <h2 class="uline">タイトル[date]</h2> とすると、[date]のフォントが大きすぎます。 この日時([date])をタイトルの"右端"にレイアウトして、 フォントサイズを12px(85%?)にしたいのですが、どうしたら良いでしょうか? <h2 class="uline">タイトル</h2>[date] とすると、[date]の前で、改行されてしまいます。 一行で、文字の大きさを変えたいのです。出来ませんでしょうか? スタイルシートは、以下の様になっております。 よろしくご指導下さい。お願いします。 /* 初期化 */ h1,h2,h3,h4{font-size: 14px;font-weight: normal;} hr{display: none;} /*コンテンツ*/ #content { width: 650px; margin: 0; margin-bottom: 20px!important; text-align: left; float: left;} #content h2{ margin-top: 5px; color: #CCC; font-size: 143%; line-height: 150%; font-weight: bold; display: block; text-align: left;} /*その他属性*/ .line{clear: both;margin: 10px 0 20px 0;border-bottom: 1px solid #555;} .uline{border-bottom: 1px solid #555;}

  • CSS
  • 回答数2
  • ありがとう数2

質問者が選んだベストアンサー

  • ベストアンサー
  • t_ohta
  • ベストアンサー率38% (5076/13259)
回答No.1

<h2 class="uline"><span style="font-size:12px;float:right;">[date]</span>タイトル</h2>

yama3desu
質問者

お礼

t_ohtaさん、出来ました~。ありがとうございます。 素晴らしいです。出来るんですね。 無理じゃ無いかと思ってましたので、嬉しすぎます。 <span style="font-size:12px;float:right;">[date]</span>を先に書くのがミソなんですね。 スイマセン。よく分かってないのですが、結果オーライで、ありがとうございました。 (^o^)

その他の回答 (1)

  • utun01
  • ベストアンサー率40% (110/270)
回答No.2

無理に<h2>を使う必要はありません。 細かく指定する際には<div class="***">で全部の要素を作って、クラスでCSSを適用する方がスムーズに出来ますよ。

yama3desu
質問者

お礼

utun01さん、ありがとうございます。 そうしたいのですが、 ブログのテンプレートなので、色々、変更するには、 応用が利かずに、困ってました。 今後、努力していきます。ありがとうございました。

関連するQ&A

  • cssでtableを指定したい

    教えてください。 cssでテーブルを指定しているのですが、別の幅のテーブルを指定したいときはどうすればよいのでしょうか。 現在はこういうふうに書いています。ちょっと汚いですが。。。 ----------------------------- #content #main p{ margin:10px 18px 25px; font-size:12px; } #content #main table { border-collapse: collapse; background-color: #FFFFFF; width: 480px; margin:0px padding; border: 0px #000000: 1px; } #content #main caption{ text-align: right; padding-right: 5px; font-size:12px; } #content #main th {     border: #999999 1px solid; font-size:12px; font-weight: normal; background-color: #D8EAFC;      padding: 5px; } #content #main td{ border-right: #999999 1px solid; border-top: #999999 1px solid; border-left: #999999 1px solid; border-bottom: #999999 1px solid; font-size:12px; text-align: left;      padding: 5px; } ----------------------------- 実際にタグを書くときは、こう書いています。 ----------------------------- <table> <tr> <th>aaaa</th> <td>5555555555555555555555555555</td> </tr> </table> ----------------------------- これをmaintable subtable というふうに幅が違うものにしたいのですが、cssにmaintableを追加して、<table class=maintable">と指定しても、maintableではなく、tableで表示されます。 こういう場合はどうすればよいのでしょうか?

    • ベストアンサー
    • XML
  • 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 ブログ本文とサイドバーのバランス

    質問させてください! weeblyの2カラム標準テンプレートを使用しweb siteを運営しているのですが、 両端の空白をもう少し縮め、本文とサイドバーをその分広げたいと思い、CSSを 調整しようと調べながら各数値を変更してみたのですがうまくいきません。 どの数値を変更するべきなのか教えていただけたらと思います。 理想のサイトのリンク先も貼付けておきます。 http://www.fecalface.com/ body { background-color:#fff; font-family:"helvetica",arial,sans-serif; font-size:62.5%; color:#777; margin:0; padding:0; } acronym { cursor:help; border-bottom:1px dotted #ddd; } #container { font-size:1.2em; width:800px; margin:0 auto; } #header { color:#444; margin:0; padding:0px; background:#fff url(%%HEADERIMG%%) no-repeat bottom right; } #header h1 { font-family:"helvetica",arial,sans-serif; font-size:2em; color:#333; margin:30px 0 0 0; font-weight:normal; line-height:1.5; } #header h1 strong { color:#c00; } #header h2 { margin:1000px 0 0 0; font-size:1em; font-weight:normal; color:#999; } #navigation { text-align:right; margin:10px 10px 10px auto; } #navigation { margin:0 10px 0 0; padding:0; } #navigation li { margin:0; padding:0; list-style:none; display:inline; } #navigation li a { padding:5px 6px 2px 4px; margin:0 2px 0 0px; color:#000000; text-decoration:none; font-weight:helvetica; border-bottom:1px solid #ddd; } #navigation li a:hover { color:#C00; border-bottom:1px solid #c00; } #active a:link { color:#C00; border-bottom:1px solid #c00; } #active a:hover { color:#C00; border-bottom:1px solid #c00; } #active a:visited { color:#C00; border-bottom:1px solid #c00; } #content { margin:20px 0 20px 10px; padding:0; } #content p { padding:2px; text-align:justify; line-height:1.5; } #content h1 { display:block; margin:50px 0 0 10px; padding:0; font-family:"helvetica",arial,sans-serif; font-size:1.8em; color:#c00; border-color:#ddd; border-style:solid; border-width:0 0 1px 0; } #content h2 { display:block; margin:40px 40px 0 0px; padding:0 長くなってしまいましたがよろしくお願いします!

    • ベストアンサー
    • 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; }

  • 幅を広げたいのに文字が隠れ(?)る

    下記のように分かれているページがあります。 ┌───────┐ │へっだ      │ ├─┬───┬─┤ │め│めいん│※│ │に│     │  │ │ゅ│     │  │ ├─┴───┴─┤ │ふった      │ └───────┘ 『※』の部分に文字などもなく不自然にスペースができています。 『めいん』の幅以上の文字を入れると、文字が隠れてしまいます。 『※』の部分まで『めいん』を伸ばし、2カラムにしたいのですが、 他所の幅を変更するだけでは解決できず、質問をさせていただきました。 質問部分のコードは下記の通りです。 (ヘッダ・フッタ省略) 【HTML部分】 <!-- メインコンテンツ --> <div id="container"> <div id="contents"> ~省略~ </div> <!-- メインコンテンツ終わり --> <!-- メニュー --> <div id="menu"> ~省略~ </div> <!-- メニュー終わり --> </div> <!-- コンテンツ終わり --> 【CSS部分】 /*---------- コンテンツ ----------*/ #container { width: 1000px; overflow: visible; margin: 0px; padding: 6px; background-color: #ffffff; } /*---------- メインコンテンツ ----------*/ #contents { float: right; margin: 0; padding: 5px 10px 5px 0; font-size: 12px; line-height: 180%; width: 1000px; letter-spacing: 1px; } #contents #pannavi { margin: 0; padding: 0 0 5px 0; font-size: 12px; } #contents h2 { height: 27px; margin: 0 0 4px 0; padding: 8px 0 0 20px; font-size: 12px; color: #333333; background-image: url(img/titlebar.gif); background-repeat: no-repeat; } #contents h3 { margin: 12px 5px 10px 6px; padding: 8px 10px 5px 13px; line-height: 110%; font-size: 13px; color: #444444; border-left: solid 5px #aaaaaa; background-color: #eeeeee; } #contents h19 { margin: 12px 5px 10px 6px; padding: 8px 10px 5px 13px; line-height: 110%; font-size: 13px; color: #444444; border-left: solid 5px #eeeeee; background-color: #eeeeee; } h4,h5 { font-size:18px; font-weight:bold; color:#7e603b; } h7 { font-size:10px; font-weight:lighter; color:#7e603b; } h8 { font-size:13px; font-weight:bold; color:#7e603b; } h9 { font-size:13px; font-weight:bold; color:#cccccc; } h10 { font-size:13px; font-weight:bold; color:#000000; } h11 { font-size:18px; color:#000000; } #contents p { margin: 3px 0 3px 0; padding: 0 5px 0 5px; line-height: 180%; font-size: 12px; } #contents a { color: #c9171e; font-size: 12px; } #contents a:hover { color: #e83929; font-size: 12px; } #contents img.head_photo { margin: 0 0 10px 50px; } #contents img.photo { float: left; margin: 10px 20px 0 0; } #contents img.picture { margin: 0 10px 10px 0; float: left; } #contents p.photo { margin: 0 0 20px 0; padding: 0; } table#t01 { border: solid 1px #999999; border-collapse: collapse; } td#t01 { border: solid 1px #999999; border-collapse: collapse; } td#head { padding: 7px 6px 5px 10px; border: solid 1px #999999; border-collapse: collapse; } table.table_line { border-collapse: collapse; margin : 10px 0 0 0; } td.table_line { border-collapse: collapse; padding : 9px 14px 7px 14px; border-bottom: solid 2px #fffffc; } どうか、ご教授お願いいたします。

    • ベストアンサー
    • CSS
  • MacからアップしたCSSがWinで反映されな

    こんにちは。現在、Macでホームページを作っています。 その際、CSSでレイアウトやフォント等を設定したのですが、アップロードしたCSSがWindowsでは反映されません。Macではすべてしっかり反映されています。 ブラウザごとの振り分け等、色々と調べて試しましたが変わりませんでした。 どこかおかしなところがあれば指摘、アドバイスの方よろしくお願い致します。 ↓<head></head>内 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <title>(タイトル)</title> <link rel="stylesheet" type="text/css" href="main.css"> ↓main.css * { margin: 0; padding: 0; } body,table,tr,td { font-size: 10px; font-family: "Times" ""Osaka"; line-height: 160%; text-align: left; } a:link {color: #000000; text-decoration: none; } a:visited {color: #000000; text-decoration: underline; } a:active {color: #000000; text-decoration: underline; } a:hover {color: #000000; text-decoration: none; } #layout { width: 650px; margin-top: 10px; margin-left : auto; margin-right : auto; text-align : center; } .header { margin: 5px 0px 3px; padding: 20px 10px; border: 1px solid #c0c0c0; background-image: url("(画像URL)") } #main { float: left; width: 436px; margin: 10px 14px 0px 0px; } .entry { border: 1px solid #c0c0c0; margin: 0px 0px 14px 0px; padding: 10px 30px; overflow: auto; } .entry_navi { text-align: left; } .entry_title { font-size: 13px; font-family: "Times"; border-bottom: 1px dashed #c0c0c0; color: #000000; } #side { float: right; width: 200px; margin: 10px 0px ; } .pict { margin: 15px 0px; padding: 8px; border: 1px solid #c0c0c0; } h1 { font-size: 20px; font-weight: bolder; font-family: "Times"; margin: 0px 0px 5px 0px; padding: 0px; color: #ffffff; } h1 a, h1 a:link, h1 a:visited, h1 a:active, h1 a:hover { color: #ffffff; text-decoration: none; } .description { font-size: 10px; color: #ffffff; padding-bottom: 30px; } .list { border: 1px solid #c0c0c0; margin: 0px 0px 14px 0px; padding: 10px 20px; } .list_title { font-family: "Times"; font-size: 16PX; font-weight: bolder; color: #000000; border-bottom: 1px dashed #C0C0C0; }

    • ベストアンサー
    • CSS
  • 画像のtext-align:center;について

    http://loveosan0801.uijin.com/content/ishida.html 上記URLの画像がcenterに配置されません。 どのように修正すれば、centerに配置されますでしょうか? お教えいただけませんか? body { font-size:14px; line-height:150% } h1 { color:black; border-left:10px solid #cccccc; border-right:10px solid #cccccc; border-top:1px solid #cccccc; border-bottom:1px solid #cccccc; font-size:16px; padding:10px 0 10px 0; text-align:center; } p { text-align:left; border-left:10px solid #cccccc; border-right:10px solid #cccccc; padding:0 0 0 20px; } #center p { text-align:center; } #menu { list-style-type:none; text-align:center; } #menu li { display:inline; border-right:5px solid #cccccc; padding:0 20px 0 20px; } .main { width: 100%; } .main div { width: 50%; margin: 0 auto; }

    • ベストアンサー
    • HTML
  • フォントと文字サイズの指定方法

    HTML初心者です。 どなたか助言ください。 以下のソースのようなテンプレHTMLを変更しないといけなくなりました。 以下のソース部分のフォントと文字サイズを指定するにはどのようにすればよろしいでしょうか? <!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 http-equiv="X-UA-Compatible" content="IE=7" /> <title><?=$item_title?></title> </head> <body> <div style="width:100%;text-align:center"> <div id="wrapper" style="margin:0px auto;font-family:Arial, Helvetica, sans-serif;font-size:20px;color:#000;text-align:left;"> %IMAGES% <div class="sub_tit" style="padding-left:5px;height:25px;line-height:25px;border-left:solid 20px;color:#2214ff;font-size:25px;font-weight:bold;"> PRODUCT DETAILS </div>   ****以下で出力される文字のフォントと文字サイズを指定したい。 <p class="sub_text" style="padding-left:10px;padding-right:20px;"> %DESCRIPTION% </p>   **** ......同じような内容が続く </body> </html> よろしくお願いいたします。

    • ベストアンサー
    • HTML
  • 背景色を変更した所、文字が背景色と被って見づらく

    引き続き質問です。元からあった無料cssテンプレートは背景が黒く、 暗いイメージを持たれると困るとのことで白色の背景に変更しました。 すると、ホームページに記載されている文字が白色の為何が書いて あるか見えなくなってしまいました。 現在は全てのサイト上の文字に<font color="black">何でも</font> というタグを付けて応急措置を考えておりますが、元から文字の色を 全て黒色に指定することはできないものでしょうか。 HPは全くの素人で、どの部位を変更すると良いかご指南いただければ幸いです。 @charset "UTF-8"; /* --------------------- * FONTSIZE MODEL * * --------------------- * 63% -> 10pxに相当 * 70% -> 11pxに相当 * 75% -> 12pxに相当 * 82% -> 13pxに相当 * 88% -> 14pxに相当 * 94% -> 15pxに相当 * 100% -> 16pxに相当 * 107% -> 17pxに相当 * 113% -> 18pxに相当 * 119% -> 19pxに相当 * 125% -> 20pxに相当 * --------------------- */ /* ========BASIC======== */ html { overflow-y:scroll; } body { margin:0; padding:0; line-height:1.6; letter-spacing:1px; font-family:Verdana, Helvetica, sans-serif; font-size:13px; color:#fff; background:#FFF; } br { letter-spacing:normal; } a { color:#d1d1d1; text-decoration:none; } a:hover { color:#666; } img { border:0; vertical-align:bottom; } h1,h2,h3,h4,h5,h6 { margin:0; } /* ========TEMPLATE LAYOUT======== */ #top { width:780px; margin:0 auto; } #contents { float:left; width:780px; } #side { float:left; width:220px; background:#181818; padding:10px 0; } #main { float:right; width:540px; padding:10px 0; } #footer { width:540px; margin-left:240px; } /* ========SIDE CUSTOMIZE======== */ #side h1 { margin:0; font-size:24px; } #side h1 a { color:#fff; } #side h1 a:hover { color:#ddd; } #side div.section { margin:0 10px; } /* ========MENU CUSTOMIZE======== */ #menu ul { margin:0 auto; padding:10px 0; } #menu li { color:#333; text-align:center; list-style-type:none; } #menu li a { display:block; width:220px; color:#f1f1f1; line-height:60px; } #menu li a:hover { color:#f1f1f1; background:#2d2d2d url("../images/bg_menu.gif") 0 0 repeat; } /* ========MAIN CONTENTS CUSTOMIZE======== */ #main #pr p { margin:0; padding:5px 0; } #main #icatch { margin-bottom:10px; } #main a { color:#d1d1d1; } #main a:hover { color:#f1f1f1; text-decoration:underline; } #main h2 { margin-bottom:8px; padding:0 0 0 10px; font-size:15px; font-weight:bold; line-height:35px; border:1px solid #3e3e3e; background:#181818; } #main h3 { clear:both; margin:20px 0 8px 0; padding:0 0 0 5px; font-size:14px; border-left:5px solid #3e3e3e; } #main h4 { margin-bottom:2px; font-size:14px; border-bottom:2px solid #f1f1f1; } #main h5 { margin-bottom:2px; padding:2px 5px; font-size:13px; background:#3e3e3e; } #main h6 { margin-bottom:2px; font-size:13px; border-bottom:2px solid #3e3e3e; } #main p { margin:0 0 1em 0; } #main dt { margin-bottom:3px; } #main dd { padding:0; margin:0 0 0.5em 1em; padding:3px; color:#ddd; background:#181818; } /* INFORMATION CUSTOMIZE */ * html body #main dl.information dd div { display:inline-block; } #main dl.information dt { float:left; width:10em; margin:0; padding:0; color:#fff; } #main dl.information dd { margin:0 0 0.5em 10em; padding:0; color:#fff; background:transparent; } #main table { width:100%; border-collapse: collapse; } #main table th { padding:5px; font-size:12px; text-align:left; border:1px solid #ddd; background:#181818; } #main table td { padding:5px; font-size:12px; text-align:left; border:1px solid #ddd; } /* ========PAGETOP CUSTOMIZE========= */ #pageTop { padding:10px 0; text-align:right; font-size:11px; } #pageTop a{ padding:0 0 0 12px; background:url("../images/bg_pagetop.gif") 0 60% no-repeat; } /* ========FOOTMENU CUSTOMIZE======== */ #footMenu ul { margin:0; padding:10px 0 0 0; text-align:right; border-top:1px solid #b4b4b4; } #footMenu li { display:inline; margin:0 0 0 10px; list-style:none; } よろしくお願いします。

    • ベストアンサー
    • HTML
  • 角丸にしたDiv内の画像の角がはみ出してしまう

    よろしくお願いします。 参考書片手にCSSを勉強しています。 品物の画像をスマホで見られるページを作っているのですが、 角丸にしたDiv内の画像の角がはみ出してしまい、対処法がわからず悩んでいます。 どのような方法がありますでしょうか。 初歩的な質問で恐れ入りますがご教授お願いします。 <!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=utf-8"> <title>じっけんじっけん</title> <style type="text/css"> <!-- body, p, h1, h2, h3, img, table, div, ul, li { margin: 0px; padding: 0px; font-family: Helvetica, sans-serif; } #wrap { background-color: #EEEEEE; height: auto; width: 100%; margin: 0px; padding-top: 100px; padding-right: 0px; padding-bottom: 50px; padding-left: 0px; } .title { width: 100%; margin-right: auto; margin-left: auto; } .main { background-color: #FFFFFF; width: 96%; margin-right: auto; margin-left: auto; box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.2); box-shadow:0px 0px 2px #555; margin-bottom: 100px; border-radius: 20px; } p.resizeimage img { width: 100%; } .itemnum { color: #7D7D7D; font-size: 40px; padding: 30px; border-bottom-width: thin; border-bottom-color: #C0C0C0; line-height: 50px; float: left; } .price { color: #7D7D7D; font-size: 52px; padding: 30px; border-bottom-width: thin; border-bottom-style: solid; border-bottom-color: #C0C0C0; line-height: 60px; text-align: right; } .itemname { color: #7D7D7D; font-size: 40px; padding: 30px; border-bottom-width: thin; border-bottom-style: solid; border-bottom-color: #C0C0C0; line-height: 54px; font-weight: bold; } .detail { color: #7D7D7D; font-size: 40px; padding: 30px; border-bottom-width: thin; border-bottom-style: solid; border-bottom-color: #C0C0C0; line-height: 48px; } --> </style> </head> <body> <div id="wrap"> <div class="main"> <p class="resizeimage"> <img src="p/a.jpg"> </p> <p class="itemnum">32×13×22cm</p> <p class="price">¥10,000</p> <p class="itemname">アイテム</p> <p class="itemname">Aタイプ</p> </div> <div class="main"> <p class="resizeimage"> <img src="p/b.jpg"> </p> <p class="itemnum">35×14×24cm</p> <p class="price">¥10,000</p> <p class="itemname">アイテム</p> <p class="itemname">Bタイプ</p> </div> </div> </body> </html>

    • ベストアンサー
    • CSS

専門家に質問してみよう