[ 5 posts ]

clair smith

  • Username: clairesmith1
  • Joined: Tue Jun 21, 2011 3:52 am
  • Posts: 1
  • Offline
  • Profile
Tags:

How can i use class in CSS?

Post Posted: Mon Jul 04, 2011 1:18 am
+0-
Hello,


Can i know the roll of class in CSS?
How can it use?
Please anyone help me.

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 352
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile

Re: How can i use class in CSS?

Post Posted: Tue Jul 05, 2011 7:17 am
+0-
There are many web sites devoted to explaining CSS. Here is one: http://www.w3schools.com/css/default.asp

Ganus

  • Username: ganusi58
  • Joined: Wed Apr 11, 2012 3:30 am
  • Posts: 3
  • Location: Boeblingen
  • Offline
  • Profile
Tags:

Re: How can i use class in CSS?

Post Posted: Tue Apr 17, 2012 12:40 am
+0-
The class in CSS is used to specify a style for a group of elements. If you don't like the id selector, the class selector is most often used on several elements.

Example

<p class="test">wedqw qwd qwdq qwd qwd qwd qw</p>

dora

Tags:

Re: How can i use class in CSS?

Post Posted: Thu Jun 07, 2012 12:18 am
+0-
I agree with Johan its really easy here i can give an example to:

Html:

<p class="test1">text-test1</p>


CSS:

.test1{
color:blue
font-family:"Times New Roman";
font-size:20px;
}

Ashtechsmith

Tags:

Re: How can i use class in CSS?

Post Posted: Wed Jun 13, 2012 4:16 pm
+0-
The Format of Classes

Using classes is simple. You just need to add an extension to the typical CSS code and make sure you specify this extension in your HTML. Let's try this with an example of making two paragraphs that behave differently. First, we begin with the CSS code, note the red text.
CSS Code:

p.first{ color: blue; }
p.second{ color: red; }

HTML Code:

<html>
<body>
<p>This is a normal paragraph.</p>

<p class="first">This is a paragraph that uses the p.first CSS code!</p>
<p class="second">This is a paragraph that uses the p.second CSS code!</p>
...

Display:

This is a normal paragraph.

This is a paragraph that uses the p.first CSS code!

This is a paragraph that uses the p.second CSS code!

You can use CSS classes with any HTML element! However, what happens if we had already defined a value for the default <p> tag, would this cause any problems for classes of the paragraph tag?
  [ 5 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum