part4: learn Html-Display block and inline

0 24
Avatar for yara
Written by
3 years ago

before I talk about Css in the future ,You have to know that each Html element has a default style,They aren't all the same

Try this:-

open your notepad or IDE and copy this inside then run it in your browser .

<!DOCTYPE html>
<html>
<head>
<title>Nana</title>
<meta charset="utf-8">
<style>
body{ background-color:white;
 margin: 0 10%;
 font-family: sans-serif;}
h1{text-align:centre;border-bottom:1 px solid #57b1dc;}
</style>
</head>
<body>
text 
text
<p>block element paragraph</P>
text 
text
</body>
</html>

what just happened?

why the text is in-line and the paragraph is a "block"?-well this is the stander Html style note you can change the inline to block and the block element to inline by Css we will talk about later tho,So You have two elements in html inline and block .

this is how the code looks by the way

final look

ask things if you have any questions and you can share your code with us by using codepen

1
$ 0.01
$ 0.01 from @TheRandomRewarder
Avatar for yara
Written by
3 years ago

Comments