Wrong Coding

Joined
Apr 19, 2023
Messages
4
Reaction score
0
Hello. I got my coding wrong. The font for the second sentence is supposed to be smaller and in the color green. The last two sentences are supposed to be the aligned to the left and in 12pt font. What did I do wrong?

<!DOCTYPE html>
<html>
<head>
<title>The Monk Diamond</title>
<style>
.header {
background-color: lightblue;
padding: 25px;
text-align: center;
font-size: 18pt;
width: 100%;
height: 25%;
}
.title {
font-size: 14 pt;
text-align: center;
color: gray;
}
.body {
margin: 20px;
}
</style>
</head>
<body>
<div class="header">
The Monk Diamond<br/>
An incredible discovery
<div/>
<br/>
<div class="title">
Stolen diamond found on expedition in Siberia!
<div class="body">
Professor Bairstone and Dr. Day were looking for fossils in Siberia.<br/>
They found the stolen diamond hidden inside a remote cave.
</div>
</body>
</html>
 
Joined
Sep 4, 2022
Messages
126
Reaction score
16
Hello,


you ask for 'html/css' in the 'c/c++' main thread : ask admin to move your question.


you have one missing closing tag 'div' , it's Html error. with a missing tag you have structure defaults, then display css defaults too.

you use native keywords ( header / body /title ) as classes Names, choose others name or you'll be lost quickly.
 
Joined
Apr 19, 2023
Messages
4
Reaction score
0
Thanks. I corrected one error. However, the third sentence is still not in 12pt font, the second sentence is still not in 14pt font and only the first sentence should be highlighted in blue. I checked the code dozens of times.
 
Joined
Mar 31, 2023
Messages
95
Reaction score
8
Here is the fix the code

PHP:
<!DOCTYPE html>
<html>
<head>
<title>The Monk Diamond</title>
<style>
.header {
background-color: lightblue;
padding: 25px;
text-align: center;
font-size: 18pt;
width: 100%;
height: 25%;
}
.title {
font-size: 14 pt;
text-align: center;
color: gray;
}
.body {
margin: 20px;
}
</style>
</head>
<body>
<div class="header">
The Monk Diamond<br/>
An incredible discovery
</div>
<br/>
<div class="title">
Stolen diamond found on expedition in Siberia!
</div>
<div class="body">
Professor Bairstone and Dr. Day were looking for fossils in Siberia.<br/>
They found the stolen diamond hidden inside a remote cave.
</div>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,708
Messages
2,569,347
Members
44,653
Latest member
Angus30T19

Latest Threads

Top