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


Different ways of applying CSS in HTML

applying css in html

  • Please log in to reply
&nsbp;

#1 Ammar11

Ammar11

    Senior Member

  • Designer
  • 197 posts

Posted 30 July 2012 - 11:10 AM

Hi..

What are the different ways of applying CSS in HTML ?

thanks

#2 DesignProf

DesignProf

    Junior Member

  • Designer
  • 11 posts

Posted 30 July 2012 - 11:26 AM

Different ways of applying CSS in HTML

1.In-line style
In-line styles plonk straight into the HTML tags with the style attribute.
Ex.

<p style="color: blue">text</p>
This will make the paragraph blue.

2.Internal style
internal or embedded styles are used for the entire page. Inside the style tags, the Head tags surrounding all of the pages styles.
External
External styles are used for all the pages in a website and it’s code is placed in a separate CSS file, ex.

p {
color: blue;
}

a {
color: red;
}
This file should be saved as "web.css" and then we can link it to the HTML like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.abc.net/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>CSS ex</title>
<link rel="stylesheet" type="text/css" href="web.css" />

#3 isaadansari

isaadansari

    Member

  • Designer
  • 47 posts

Posted 01 August 2012 - 05:35 PM

there are 3 ways:

<h1 style="font-size:2.5em;font-weight:bold;color:#990000;">Sample
Headline</h1>


<link rel="stylesheet" href="style.css" media="screen" />


<style>
h1 {font-size:1.5em; color:#990000;}
p {font-size:.9em; line-height:140%;color:#000000;}
</style>





Also tagged with one or more of these keywords: applying css in html

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users