Setup Cascade Style Sheets (CSS) in HTML files
Cascade Style Sheets (css) are used for styling web pages. HTML holds the content part of the document while css holds the formatting information of the content. Setup css in html is for providing format and features, e.g. different colors, height and width specifications, background images, different fonts and margins, to html. It makes HTML page more presentable.
Three different ways to setup css in html are listed below:
•
•
•
Inline style
Internal style sheet
External style sheet
Inline style parameters are placed inside the HTML code itself. It is used to provide unique styling to specific area or lines of the HTML content. For example, color property of css has been used below to provide red color to the TEXT1 paragraph in HTML page.
<p style=”color:red”> TEXT1.</p>
Thus inline styling will change the original HTML code. Such a practice is usually avoided by a good web designer.
Internal style sheet is used to provide styling to the single web page. So the <style> tag of internal style will start just after the <head> tag of the HTML page. Thus within the <style> tags all the internal styling information of the page will reside.
E.g. in the example below, red color font and left margin of 10 is provided to the whole html page.
<head>
<style type=”text1/css”> …….
……..
p {color:red; margin-left:10px ;}
</style>
</head>
External style is used to provide styling to many pages. So it is possible to provide a makeover to a web site by changing its looks. <link> tag will be used to link each web page to the external style sheet. On HTML page, <head> tag will be followed by <link> tag. External style information will reside in separate CSS file.
Recent Topics
- Working with Images in HTML Documents
- Webpage Forms in HTML
- Web Safe Colors in HTML
- Use Ordered Lists in a Webpage
- Top Graphic Editing Software in Webpage Design
- Tables and Frames in HTML
- Structure of an HTML Document
- Setup Cascade Style Sheets (CSS) in HTML files
- HTML and XHTML in Webpage Creation
- HTML and Meta Tags for Search Engine Optimization
- How to Validate HTML File
- How to Use Hexadecimal Color Codes in HTML
- How to Create Website Banners
- Formatted Lists in HTML Document
- Embedding HTML in PHP





