Skip to main content

Explaining:Styling a Webpage

Ok... So lets understand the code we made in the previous post..


<html>
<head>
<title>CSS Practise</title>
<style>
body{
font-family:"Comic Sans MS";
}
h1 {
text-align:center;
color:blue;
}

h2{
color:red;
}
p{
color:green;
}
</style>
</head>
<body>
<h1>This is a webpage all about rabbits</h1>
<h2>Many people love rabbits and I love them too...Do you?</h2>
<p>Rabbits are animals which have furry skin and they like to eat carrots...</p>
<body>
</html>









Now lets see the code...
body{
font-family:"Comic Sans MS";
}
This part tells that we want to style the body of the webpage....
we have used font-family which is used when we want to give a nice font to our text...as you can see I have given the font family "Comic Sans MS". You can keep your own font family!!!


h1 {
text-align:center;
color:blue;
}
This part tells that we want to style the h1 part of the webpage.....
We have used text-align to keep the text in the centre of the webpage

h2{
color:red;
}

This part is used to give the text is color.... so this is just for now... we will do more further in the next post..:D

Comments

Popular posts from this blog

Tables...

Ok.... So now we are done with a lot of lists.. now let us study about tables... Well all of you know what are tables...Now lets make a table in HTML... <html> <body> <table style="width:100% border="1" ">   <tr>     <td>Jill</td>     <td>Smith</td>            <td>50</td>   </tr>   <tr>     <td>Eve</td>     <td>Jackson</td>            <td>94</td>   </tr>   <tr>     <td>John</td>     <td>Doe</td>            <td>80</td>   </tr> </table> </body> </html> Your result must be somewhat like this :- ok now lets understand this code... Tables are defined w...

HTML CONTEST IN JUNE 2015

THIS IS AN IMPORTANT POST!!!PLEASE READ IT So we have done a lot of practice till now.....Now is the time..start preparing yourself for the contest.... About the Contest :- The contest will begin in June and you will be given some time to complete the task given to you.... Keep bringing people here so that there may be a tough competition and till then keep practicing... Prize :- Your name will be there at the home page for 10 days ALL THE BEST .. NOTE :- The contest may postpone if there are insufficient participants....

Beginning With CSS

Now lets begin with CSS... Now lets see an image below and see the syntax of CSS:- A CSS rule set consists of a selector and a declaration block The selector tell which html element to be styled.... The declaration block contains one or more declarations separated by semicolons. Each declaration includes a property name and a value, separated by a colon. Now lets see an example.... p {color:red;text-align:center;} You can see that there are two declarations in the first line...To make the code neat we can put one declaration on   each line....  p  {      color:  red;      text-align:  center; } The answers to the first assignment will be given soon..we will start with "Comments" from the next post...