You are here:Home » Web Designing » Create Simple Web Page Layout by Using HTML / CSS

Create Simple Web Page Layout by Using HTML / CSS

Create web page design using HTML and Decorate using CSS. 

Simple Web Page Design Using HTML/ CSS.
Web Page Design
1. Design a third heading in css with following properties and values:
  • The background color of the heading is #338833
  • The heading text should be at center with its width 40% of the general screen.
  • The padding of the heading box is 20px.
  • Font color is #abcdef, its weight is normal and the size is 3em.
  • Set the margin to 0px;
  • Apply the capitalize text transform
  • See the output in the text browser. Use internal style sheet. Use <style> </style> tag inside the head.
2. Create a class called paragraph, with following properties and values.
  • The background color of the paragraph is #af12ab and the text color is completely black.
  • The entire margin is 0px and padding is 20px.
  • The width of the class is 40% of the browser window.
  • The text should be justified.
  • See the output in the text browser by assigning the class to <p> tag. Use internal style sheet. Use style> </style> tag inside the head.
3.Combine the headers and paragraph in a single page with some content in them and see the output in the browser.

4. Create an ID called container1 with the following properties:
  • Display should be inline and it should float to the right side of the screen.
  • Margin should be 0px.
  • Width is 60% and height should be 80%
  • Background color is #CCC
  • Se the ID created with the <div> ….</div> tag.
5. Now nest the property of the heading and paragraph with the new ID container1. The container1 should now contain the heading and paragraph elements.
  • Please remove the width property of the header and paragraph.
6. Create a second ID called container2 with the following properties:
  • The display should be inline and float should be left.
  • Margin should be 0px
  • Background color should be #ccc
  • Width is 60% and height should be 80%
  • Padding should be 0px
  • Fill some random content inside the div having ID container2 and see the changes in the browser.
7.Combine the container2 and container1. I.e. first place the container2 in the body and then container1 along with their content.

8. Design a footer with the following properties:
  • Footer should be at the bottom and its background color is #dcd656
  • The width of the footer is full screen.
  • The text color should be completely white.
  • Margin, padding are 0px
  • Height of the footer is 20%;
9. Combine footer too in Q.N 7 at last.

HTML Code

<html>
 <head>
  <title>CSS Layout Example</title>
  <link rel="stylesheet" type="text/css" href="style.css" />
 </head>
 <body>
  <div id="container">
   <div id="header">
    <h1> Site name </h1>
   </div>
   <div id="navigation">
    <ul>
     <li>
      <a href="#">Home</a>
     </li>
     <li>
      <a href="#">About</a>
     </li>
     <li>
      <a href="#">Services</a>
     </li>
     <li>
      <a href="#">Contact us</a>
     </li>
    </ul>
   </div>
   <div id="content-container1">
    <div id="content-container2">
     <div id="section-navigation">
      <ul>
      <li>
      <a href="#">Section page 1</a>
      </li>
      <li>
      <a href="#">Section page 2</a>
      </li>
      <li>
      <a href="#">Section page 3</a>
      </li>
      <li>
      <a href="#">Section page 4</a>
      </li>
      </ul>
     </div>
     <div id="content">
     <h2> Page heading </h2>
     <p>
     Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
      </p>
     <p>
     Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
     </p>
     <p>
     Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
     </p>
     <p>
     Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
     </p>
     <p>
     Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
     </p>
     </div>
     <div id="aside">
     <h3> Aside heading </h3>
     <p>
     Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan.
</p>
     </div>
     <div id="footer">
      Copyright &copy; Site name, 20XX
     </div>
    </div>
   </div>
  </div>
 </body>
</html>

CSS Code

Copy the CSS code and save it into style.css file or you can put inside the <head></head> section

*{
 margin: 0;
 padding: 0;
}
#container
{
 margin: 0;
 width: 100%;
 background: #fff;
}
#header
{
 background: #ccc;
 padding: 20px;
}
#header h1 { margin: 0; }
#navigation
{
 float: left;
 width: 100%;
 background: #333;
}
#navigation ul
{
 margin: 0;
 padding: 0;
}
#navigation ul li
{
 list-style-type: none;
 display: inline;
}
#navigation li a
{
 display: block;
 float: left;
 padding: 5px 10px;
 color: #fff;
 text-decoration: none;
 border-right: 1px solid #fff;
}
#navigation li a:hover { background: #338833; }
#content-container1{
 float: left;
 width: 100%;
}
#content-container2
{
 float: left;
 width: 100%;
}
#section-navigation
{
 float: left;
 width: 16%;
 padding: 20px 0;
 margin: 0 2%;
 display: inline;
}
#section-navigation ul
{
 margin: 0;
 padding: 0;
}
#section-navigation ul li
{
 margin: 0 0 1em;
 padding: 0;
 list-style-type: none;
}
#section-navigation ul li a{
 text-decoration: none;
 color: #555555;
}
#section-navigation ul li a:visited{
 text-decoration: none;
 color:  #555555;
}
#section-navigation ul li a:hover{
 text-decoration: none;
 color: #000000;
 font-size: 18px;
}
#content
{
 float: left;
 width: 56%;
 padding: 20px 0;
 margin: 0 0 0 2%;
}
#content h2 { margin: 0; }
#aside
{
 float: right;
 width: 16%;
 padding: 20px 0;
 margin: 0 2% 0 0;
 display: inline;
}

#aside h3 { margin: 0; }
#footer
{
 clear: both;
 background: #ccc;
 text-align: right;
 padding: 20px;
 height: 1%;
}