Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


How to Apply CSS to HTML documents

apply css documents html

  • Please log in to reply
 

#1 DesGuru

DesGuru

    Senior Member

  • Designer
  • 220 posts

Posted 23 October 2012 - 08:41 PM

You can apply CSS to an HTML document. There are three different ways to do this
1.The In-line /the attribute style
You can apply CSS to HTML by using the HTML attribute style. It can be applied this way:
<html>
<head>
<title>Ex.</title>
</head>
<body style="background-color: #FF0000;">
<p>Usinf the red page</p>
</body>
</html>

2. Internal /the tag style
You apply CSS codes using the HTML <style> tag. It would look like this:
<html>
<head>
<title>Ex.</title>
<style type="text/css">
body {background-color: #FF0000;}
</style>
</head>
<body>
<p>Red page</p>
</body>
</html>

3. External link to a style sheet
Another way to apply CSS into HTML is the external link to a style sheet. An external style sheet is a text file with the .css extension and you can place the style sheet on your hard disk or web server.
If you have the file style1.css as your style file it’s saved in the folder stylefolder. Create a link from your default.htm HTML document to the style.css style sheet. You can do this using the below HTML code:
<head>
<link rel="stylesheet" type="text/css" href="stylefolder/style1.css" />

</head>





Also tagged with one or more of these keywords: apply css, documents, html

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users