How To Make Simple CSS Stylesheet for a Website ?


CSS language is used to simplify the process of making web pages presentable. It handles the look and feel part of a web page. Not only it makes the web development process more fast and saves the time but also makes the page loading time more faster and easier for maintenance. So today's almost all of the websites are designed by using CSS. You can design and link the CSS file very easily to the web page. In this post I am telling you on "How To Make Simple CSS Style Sheet for a Website ?" by using very simple steps and ideas. I hope that after reading this post you will able to make simple design for your web page using CSS. The format of the HTML page will be as in the image on right side.

Steps To Make Simple CSS Style Sheet for a Website


1. At first create a HTML file by using any text editor like notepad. On the HTML file write the following code and save it on the ".html" format.

<html>
<head>
<title>How To Make Simple CSS StyleSheet for a Website ?</title>
<link rel="Stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="wrapper">
<div id="banner">
<p>This is banner</p>
</div>

<div id="navigation">

</div>

<div id="content_area">
<p> This is content area</p>

</div>

<div id="sidebar">
<p> This is sidebar</p>
</div>

<div id="footer">
<p> this is footer</p>

</div>
</div>
</body>
</html>


Here I have used "id" selector for css, you can also use class selector as <div class="wrapper"> etc.

2. Then create a CSS file by using any text editor like notepad. On the CSS file write the following code and save it on the ".css" extension format.


#wrapper {
width:1080px;
margin:0 auto;
padding:10px;
border:5px solid #dedede;
background-color:#fff;
}

#banner {
height:150px;
border:3px solid #e3e3e3;
background-size:cover;
background-image: url("banner.jpg");
background-repeat: no-repeat;
}

#navigation {
height:50px;
border:3px solid #e3e3e3;
margin-top:20px;
width:auto;
background-image: url("nav.jpg");

}

#content_area{
float:left;
width:755px;
margin:20px 0 20px 0;
padding:10px;
border: 3px solid #e3e3e3;
text-align:justify;
}

#sidebar {
float:right;
width:250px;
height:388px;
border:3px solid #e3e3e3;
margin-top:26px;
}

#footer {
clear:both;
width:auto;
height:40px;
margin-top:20px;
background-image: url("footer.jpg");
border:3px solid #e3e3e3;
text-align:center;
color:#fff;
}



Replace the image url i.e. "banner.jpg" by your image path on the css code above.

Replace the stylesheet name "style.css" by your saved stylesheet name on the HTML code above. The stylesheet file should be on the same folder or should give the full path.

For "class" selector, you have to write the css code as the format .wrapper{ } etc.

You can add the menu items on navigation by adding HTML codes and CSS codes on HTML and CSS files copying from the previous post: How To Create Simple Menu Using CSS ?

You can add the contents on "content_area", "sidebar" and "footer" by using different HTML Tags like <p> </p> etc.


Related Posts:

How To Create Simple Menu Using CSS ?


By using CSS codes we can create websites menus more easily with very simple and small number of codes. So uses of CSS menus on websites makes your website lighter and faster, also runs on almost all of the browsers. Here I have given some useful steps and codes for creating simple menu using CSS. It may help you to make simple, attractive and awesome menu for your own website by using the following steps and codes.



To Create Simple Menu Using CSS


# At first create the following HTML codes on your webpage.

Replace the "#" with your link URL included in the HTML code below.

<div id="navigation">
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">Item1</a>
<ul>
<li><a href="#">SubItem1</a></li>
<li><a href="#">SubItem2</a></li>
<li><a href="#">SubItem3</a></li>
<li><a href="#">SubItem4</a></li>
</ul>
</li>

<li><a href="#">Item2</a></li>
<li><a href="#">Item3</a></li>
</ul>
</div>

# Create a CSS file with the following codes.

Replace the 'back.jpg' with your image file included in the css code below.

#navigation{
width:auto;
height:30px;
float:left;
background-image: url('back.jpg');
border:none;
margin-top:20px;
margin-left:0px;
}

#nav{
list-style: none;
padding:0px;
display:block;
margin-top:2px;

}

#nav li{
font-size:20px;
float:left;
position:relative;
width:180px;
hight:50px;
display:block;
align:center;
padding-left:10px;

}

#nav ul{
list-style:none;
margin:0;
padding:0;
width: auto;
display:none;

}

#nav li:hover{
background-image:url('back.jpg');
background-repeat:no-repeat;
background-size:cover;
}

#nav li:hover>ul{
display:block;
position:absolute;

}


#nav li ul{
left:0px;
margin-top:0px;
padding-top:0px;
}

#nav li ul li{
background-image:url('back.jpg');
background-repeat:no-repeat;
background-size:cover;
border:1px solid #e3e3e3;
padding-left:10px;
width:178px;
}


#nav a:link, #nav a:active, #nav a:visited{
display:block;
color:#ff00aa;
text-decoration:none;
}


# Link CSS file to the web page.

Add the following code to link CSS file to the web page between <head> tags.

<head>

<link rel="Stylesheet" type="text/css" href="style.css">

</head>

Preview of  CSS Menu











Related Posts:

Solved MCQ of Network Architecture set-1

Solved MCQ of Network Architecture set-1


1. ............................ specifies a complete set of rules for the connections and interactions of its physical and logical components for providing and utilizing communication services.

MCQ of Network Architecture
Mapa mental do TCP/IP (Photo credit: Wikipedia)
A) Computer Architecture

B) Communication Architecture

C) Network Architecture

D) Internet Architecture



2. The two most important network architecture or reference model are ...............

i) Layered reference model

ii) OSI reference model

iii) DSL reference model

iv) TCP/IP reference model


A) i and ii

B) ii and iii

C) iii and iv

D) ii and iv




3. The Open System Interconnection(OSI) reference model includes ................... layers.

A) five

B) six

C) seven

D) eight



4. ..................... is used to manage and synchronize conversation between two systems.

A) Physical Layer

B) Data Link Layer

C) Session Layer

D) Transport Layer



5. Which of the following is not the function of physical layer?

A) Converting the digital bits into electrical signal

B) Detecting and correcting errors

C) Defining voltages and data rates needed for transmission.

D) Activating, maintaining and deactivating the physical connection




6. ...................... divides the outgoing messages into packets and assembles incoming packets into messages for the higher levels.

A) Physical Layer

B) Data Link Layer

C) Network Layer

D) Transport Layer



7. The TCP/IP reference model was used earlier by ....................., before being used in the Internet.

A) ARPANET

B) PARPANET

C) USDNET

D) DODNET



8. Which of the following are True for TCP/IP reference model?

i) The TCP protocol divide large message into a sequence of packets into an IP packet.


ii) The IP protocol is used to put a message into packet.

iii) It is necessary for all the packets in a single message to take the same route each time it is sent.

iv) The packets are passed from one network to another until they reach their destination.

A) i and iv only

B) i, ii and iv only

C) i, ii and iii only

D) All i, ii, iii and iv



9. Which of the following is not the layer of TCP/IP model?

A) Internet Layer

B) Application Layer

C) Transport Layer

D) Presentation Layer



10. State whether the following statements are True or False.

i) In TCP/IP model transport layer guarantees delivery of packets.

ii) Network layer of OSI model provides both connectionless and connection oriented service.

iv) The TCP/IP model does not fit any other protocol stack.

A) i-True, ii-False, iii-False

B) i-False, ii-True, iii-True

C) i-False, ii-False, iii-True

D) i-True, ii-True, iii-False




Answers:




1. ............................ specifies a complete set of rules for the connections and interactions of its physical and logical components for providing and utilizing communication services.

C) Network Architecture


2. The two most important network architecture or reference model are ...............

i) Layered reference model

ii) OSI reference model

iii) DSL reference model

iv) TCP/IP reference model

D) ii and iv


3. The Open System Interconnection(OSI) reference model includes ................... layers.

C) seven


4. ..................... is used to manage and synchronize conversation between two systems.

C) Session Layer


5. Which of the following is not the function of physical layer?

B) Detecting and correcting errors


6. ...................... divides the outgoing messages into packets and assembles incoming packets into messages for the higher levels.

C) Network Layer


7. The TCP/IP reference model was used earlier by ....................., before being used in the Internet.

A) ARPANET


8. Which of the following are True for TCP/IP reference model?

i) The TCP protocol divide large message into a sequence of packets into an IP packet.

ii) The IP protocol is used to put a message into packet.

iii) It is necessary for all the packets in a single message to take the same route each time it is sent.

iv) The packets are passed from one network to another until they reach their destination.

B) i, ii and iv only


9. Which of the following is not the layer of TCP/IP model?

D) Presentation Layer


10. State whether the following statements are True or False.

i) In TCP/IP model transport layer guarantees delivery of packets.

ii) Network layer of OSI model provides both connectionless and connection oriented service.

iii) The TCP/IP model does not fit any other protocol stack.

B) i-False, ii-True, iii-True




Related Posts:


JDBC MCQ Interview Questions with Answers set-2

JDBC MCQ Interview Questions with Answers set-2


1. A Java program cannot directly communicate with an ODBC driver because .......
JDBC MCQ Interview Questions with Answers
ODBC Administrator (Photo credit: Wikipedia)

A) ODBC written in C language

B) ODBC written in C# language

C) ODBC written in C++ language

D) ODBC written in Basic language



2.The JDBC-ODBC Bridge driver translates the JDBC API to the ODBC API and used with .......


A) JDBC drivers

B) ODBC drivers

C) Both A and B

D) None of the above



3. The ............................. package contains classes that help in connecting to a database, sending SQL statements to the database, and processing the query results.

A) connection.sql

B) db.sql

C) pkg.sql

D) java.sql



4. The ................................ method executes a simple query and returns a single Result Set object.

A) executeUpdate()

B) executeQuery()

C) execute()

D) noexecute()



5. The ......................... method executes an SQL statement that may return multiple results.

A) executeUpdate()

B) executeQuery()

C) execute()

D) noexecute()




6. The ........................ object allows you to execute parametrized queries.

A) ResultSet

B) Parametrized

C) PreparedStatement

D) Condition



7. The .................. object provides you with methods to access data from the table.

A) ResultSet

B) Parametrized

C) TableStatement

D) Condition



8. The parameters of the PreparedStatement object are ...................... when the user clicks on the Query button.

A) initialized

B) started

C) paused

D) stopped



9. The ...................... method sets the query parameters of the PreparedStatement Object.

A) putString()

B) insertString()

C) setString()

D) setToString()



10. Connection object can be initialized using the ............................ method of the Driver Manager class.

A) putConnection()

B) setConnection()

C) Connection()

D) getConnetion()





Answers:



1. A Java program cannot directly communicate with an ODBC driver because .......

A) ODBC written in C language

2.The JDBC-ODBC Bridge driver translates the JDBC API to the ODBC API and used with .......

B) ODBC drivers

3. The ............................. package contains classes that help in connecting to a database, sending SQL statements to the database, and processing the query results.

D) java.sql

4. The ................................ method executes a simple query and returns a single Result Set object.

B) executeQuery()

5. The ......................... method executes an SQL statement that may return multiple results.

C) execute()

6. The ........................ object allows you to execute parametrized queries.

C) PreparedStatement

7. The .................. object provides you with methods to access data from the table.

A) ResultSet

8. The parameters of the PreparedStatement object are ...................... when the user clicks on the Query button.

A) initialized

9. The ...................... method sets the query parameters of the PreparedStatement Object.

C) setString()

10. Connection object can be initialized using the ............................ method of the Driver Manager class.

D) getConnetion()



Related Posts:

Interview MCQ Questions of Basic of IT Set-4

Interview MCQ Questions of Basic of IT Set-4


1. What program included in windows can be used to record sound?

A) Media Recorder
Interview MCQ Questions of Basic of IT
Mesh network topology, own work (Photo credit: Wikipedia)

B) Sound Player

C) Media Player

D) Sound Recorder



2. Which of the following is not database program?

A) DB2

B) Fox-pro

C) Ms Access

D) Ms Excel



3. Which of the following is/are HTML tags type?

A) Paired Tags

B) Singular Tags

C) Both of the above

D) None of the above



4. Which of the following is are Network topology?

A) Mesh Topology

B) Ring Topology

C) Hybrid Topology

D) All of the above



5. Which of the following is not a data type?

A) Picture/Graphic

B) Date/Time

C) Text

D) Number



6. An organized collection of logically related data is known as ...

A) Data

B) Meta data

C) Database

D) DBMS



7. Which is/are Network protocols?

A) TCP/IP

B) IPX/SPX

C) NetBEUI

D) All of the above



8. A character is equal to ..

A) One Bit

B) One Byte

C) Bits

D) All of the above



9. Which of the following input devices is also known as memory device?

A) Keyboard

B) Punch Cards

C) Joystick

D) None of them



10. A programming language that uses binary codes in ..

A) Machine Language

B) Assembly Language

C) High Level Language

D) All of the above




Answers:



1. What program included in windows can be used to record sound?

D) Sound Recorder

2. Which of the following is not database program?

D) Ms Excel

3. Which of the following is/are HTML tags type?

C) Both of the above

4. Which of the following is are Network topology?

D) All of the above

5. Which of the following is not a data type?

A) Picture/Graphic

6. An organized collection of logically related data is known as ...

C) Database

7. Which is/are Network protocols?

D) All of the above

8. A character is equal to ..

B) One Byte

9. Which of the following input devices is also known as memory device?

B) Punch Cards

10. A programming language that uses binary codes in ..

A) Machine Language