Class usage and it's example in css latest version in CSS forum
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: HTML & CSS
Page 1 of 1 • Share
Class usage and it's example in css latest version in CSS forum
Let's see that how we can use the class inside the css. Its really easy not a rocket science. IN Css we should have to start it in the head and then it will be started with the "." Dot and then we can write the name of the class let's see the example that how it works. For that
[You must be registered and logged in to see this image.]
it shows that how it works. Now note that the class name should not be start with a number other wise it will not work other web browser then Internet explorer.
We also can specify that only specific HTML element like a p for paragraph tag
Lets see an other example which will show that how CSS works with class
It will not show the result as we see in the previous example.
[You must be registered and logged in to see this image.]
- Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.center {
text-align:center}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p class="center">Welcome to new class</p>
<h1 class="center">Heading is center because of the Class</h1>
</body>
</html>
it shows that how it works. Now note that the class name should not be start with a number other wise it will not work other web browser then Internet explorer.
We also can specify that only specific HTML element like a p for paragraph tag
Lets see an other example which will show that how CSS works with class
- Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
p.center {
text-align:center}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Css class</title>
</head>
<body>
<p class="center">Welcome to new class</p>
<h1 class="center">Heading is center because of the Class</h1>
</body>
</html>
It will not show the result as we see in the previous example.
WikiLeaks- Monstars
- Posts : 26
Join date : 2011-05-29
Similar topics
» Notepad Class 4(Last Class)
» What does constructor do in class?Why we use copy constructor in class. Is it necessa
» When will I be billed for the service usage for Evo 3G
» How can I check my usage limit for My Evo 3G
» The Usage Of Exam Software in Final Term Paper
» What does constructor do in class?Why we use copy constructor in class. Is it necessa
» When will I be billed for the service usage for Evo 3G
» How can I check my usage limit for My Evo 3G
» The Usage Of Exam Software in Final Term Paper
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: HTML & CSS
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Yesterday at 12:21 pm by ali001
» Hemangiom'App
Tue Nov 05, 2024 11:25 am by ali001
» MindfulMe - Mental Health App
Mon Nov 04, 2024 10:50 am by ali001
» Learn Candlestick Patterns
Tue Oct 15, 2024 5:51 am by ali001
» Woh Pagal Si Episode 52 to 62 - Top Pakistani Drama
Sat Sep 21, 2024 6:26 pm by Mir Emmad Ali Khan Domki
» Nearu - share your socials
Sat Sep 21, 2024 1:12 pm by ali001
» Nightclub Tycoon: Idle Empire
Thu Sep 19, 2024 9:16 pm by ali001
» Carnivore - Meat Diet Recipes
Wed Sep 18, 2024 2:37 pm by ali001
» Eid Milad un Nabi Mubarak 2024 (Rabiʻ I 14, 1446 AH)
Tue Sep 17, 2024 3:44 pm by Mir Emmad Ali Khan Domki