質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
HTML5

HTML5 (Hyper Text Markup Language、バージョン 5)は、マークアップ言語であるHTMLの第5版です。

CSS

CSSはXMLやHTMLで表現した色・レイアウト・フォントなどの要素を指示する仕様の1つです。

Q&A

解決済

1回答

1266閲覧

css validator でWarning が出るが、解決の仕方がわからない。

TomofumiKimura

総合スコア65

HTML5

HTML5 (Hyper Text Markup Language、バージョン 5)は、マークアップ言語であるHTMLの第5版です。

CSS

CSSはXMLやHTMLで表現した色・レイアウト・フォントなどの要素を指示する仕様の1つです。

0グッド

0クリップ

投稿2017/04/02 08:45

今課題でこの写真と同じサイトを作らないといけないのですが、CSS Validator でWarning が出てしまいます。この警告の出どころが
ここ何ですが、イメージ説明

どうしたら警告を消して、なおかつウェブも少しも変えることはなくできるのでしょうか?

HTML

1<!DOCTYPE html> 2<html> 3 <head> 4 <meta charset="UTF-8"> 5 <link rel = "stylesheet" type = "text/css" href = "receipe2_style.css"> 6 <title>recipe2</title> 7 </head> 8 <body> 9 <h1>Recipe #1</h1> 10 <div> 11 <h2>Chocolate Rough</h2> 12 13 14 15 16 <!-- Division The <div> tag defines a division or a section in an HTML document. 17 The <div> tag is used to group block-elements to format them with CSS.--> 18 <figure><!-- image part division --> 19 <img src = "chocRough.jpg" alt="chocolate_cake"> 20 </figure> 21 22<!-- "Base" Ingredients part division --> 23 <section> 24 <h3>Base Ingredients:</h3> 25 <ul> 26 <li>110g butter</li> 27 <li>1 cup sugar</li> 28 <li>2 tsp cocoa</li> 29 <li>2&frac12; tsp golden syrup</li> 30 <li>1 cup flour</li> 31 <li>1 tsp baking powder</li> 32 <li>&frac34; cup coconut</li> 33 </ul> 34 </section> 35 36<!-- "Icing Ingredients part" --> 37 <section id= "Icing"> 38 <h3>Icing Ingredients:</h3> 39 <ul> 40 <li>1 cup icing sugar</li> 41 <li>25g melted butter</li> 42 <li>2 tsp cocoa</li> 43 <li>&frac34; tsp golden syrup</li> 44 <li>A little water to <br>combine</li> 45 </ul> 46 </section> 47 48 <p>Cream butter and sugar together. Add golden syrup. Add sifted cocoa, flour and baking powder. Add coconut. Combine and press into a shallow tin. Bake at 180&deg;c for 20 - 30 minutes. Ice while still warm. 49 </p> 50 <p>To make icing: sift icing sugar and cocoa together, stir through coconut and then add butter and enough water to mix to a stiff paste. 51 </p> 52 53 </div> 54 </body> 55</html>

CSS

1html{ 2background-color:rgb(235, 255, 249); 3color:inherit; 4} 5 6body{ 7 font-family: "Arial" , Verdana, sans-serif; 8 color:#4ca68d; 9 background-color:inherit; 10} 11 12/* Main heading */ 13h1{ 14 text-align:center; 15 font-family: "Times New", Times, serif; 16} 17/* Chocolate Rough*/ 18h2{ 19 margin:0px auto; 20 position:relative; 21 top:-50px; 22 left:-13px; 23 margin-bottom:-28px; 24 font-family: "Times New", Times, serif; 25 } 26 27h3{ 28 29 margin:0px; 30 font-family: "Times New", Times, serif; 31} 32/* Inside part */ 33div{ 34 35 background-color:#fff9eb; 36 color:inherit; 37 margin:20px auto; 38 padding:20px 15px 20px 15px; 39 border:none; 40 width:670px; 41 height:313px; 42} 43 44 45/* chocolate image */ 46figure{ 47 float:left; 48 margin:0px; 49 width:223px; 50 51 52 53 54} 55 56figure+section{ 57 border-right:1px solid; 58 59 60 61 62} 63 64/* Base_Ingredients */ 65section{ 66 width:223px; 67 float:left; 68} 69#Icing h3{ 70 margin-left:30px; 71} 72#Icing ul{ 73 74 margin-left:75px; 75} 76section ul{ 77 78 margin-bottom:0px; 79 margin-top:0px; 80 margin-left:43px; 81 padding-left:0px; 82 83 84} 85section ul li{ 86 text-indent:-4px; 87} 88 89 90 91p{ 92 text-align: justify; 93 text-justify:inter-word; 94 clear:left; 95 margin-top:0px; 96 margin-bottom:0px; 97 padding-top:20px; 98 99 100} 101 102 103 104 105コード

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

これでどうでしょうか。

CSS

1html { 2 background-color: rgb(235, 255, 249); 3 color: inherit; 4} 5 6body { 7 font-family: "Arial", Verdana, sans-serif; 8 color: #4ca68d; 9 background-color: inherit; 10} 11 12/* Main heading */ 13h1 { 14 text-align: center; 15 font-family: "Times New", Times, serif; 16} 17 18/* Chocolate Rough*/ 19h2 { 20 margin: 0px auto -28px auto; 21 position: relative; 22 top: -50px; 23 left: -13px; 24 font-family: "Times New", Times, serif; 25} 26 27h3 { 28 29 margin: 0px; 30 font-family: "Times New", Times, serif; 31} 32 33/* Inside part */ 34div { 35 36 background-color: #fff9eb; 37 color: inherit; 38 margin: 20px auto; 39 padding: 20px 15px 20px 15px; 40 border: none; 41 width: 670px; 42 height: 313px; 43} 44 45/* chocolate image */ 46figure { 47 float: left; 48 margin: 0px; 49 width: 223px; 50 51} 52 53figure + section { 54 border-right: 1px solid; 55 56} 57 58/* Base_Ingredients */ 59section { 60 width: 223px; 61 float: left; 62} 63 64#Icing h3 { 65 margin-left: 30px; 66} 67 68#Icing ul { 69 70 margin-left: 75px; 71} 72 73section ul { 74 75 margin-bottom: 0px; 76 margin-top: 0px; 77 margin-left: 43px; 78 padding-left: 0px; 79 80} 81 82section ul li { 83 text-indent: -4px; 84} 85 86p { 87 text-align: justify; 88 text-justify: inter-word; 89 clear: left; 90 margin-top: 0px; 91 margin-bottom: 0px; 92 padding-top: 20px; 93 94}

投稿2017/04/02 09:17

s8_chu

総合スコア14731

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問