HOW we can use css

Answer Posted / thoms

As sekar said css is broadly classified into following 3 types:

External Style Sheet:

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:

<head>
<link rel="stylesheet" type="text/css"
href="mystyle.css" />
</head>

Internal Style Sheet:

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section by using the <style> tag, like this:

<head>
<style type="text/css">
hr {color: sienna}
p {margin-left: 20px}
body {background-image: url("images/back40.gif")}
</style>
</head>

Inline Styles:

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly, such as when a style is to be applied to a single occurrence of an element.

To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:

<p style="color: sienna; margin-left: 20px">
This is a paragraph
</p>

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the importance of php?

599


How to write the form tag correctly for uploading files?

657


How to define a function with any number of arguments?

647


Why php was called as personal home page?

624


How can we encrypt the password using php?

636






How to delete file in php?

602


What is the correct syntax of mail() function in php?

655


Explain Whitespace Characters?

663


What is c++ polymorphism?

613


What is data structure in php?

596


What is the main difference between require() and require_once()?

607


What is the difference between unset and unlink?

623


What is the actually used php version?

606


How to make a class in php?

619


How variables are passed through arguments?

640