Introducing DotNetFunda.com on mobile http://m.dotnetfunda.com ! Be with DotNetFunda.com on the go !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 9490 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > CSS Interview Questions > How to write styles for all html element ...

How to write styles for all html elements of the same type?

Interview question and answer by: Raja | Posted on: 1/9/2009 | Category: CSS Interview questions | Views: 1753 |


Answer:

If we want to maintain uniformity in the look and feel of all same type of elements on the page, we can write CSS class with the element name.eg.

If we want to change the look and feel of all table and h1 element on the page, we can write like this.

table 

{
font-size:10pt;
font-family: Arial;
}
h1
{
font-size:14pt;
padding-left:5px;
margin:0px;
color:#094BBB;
}



The first class "table" will apply to all the tables on the page and second class "h1" will apply to all the h1 element of the page.

Note that the name of the class is not prefixed with the . (dot) as it happens with normal css class name.

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Raja

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2012 8:49:12 AM