Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: CSS
hello
I written css code in a page. In this I have a table control in div I want to that css use only for this div not entire page.
 
css code following
 
<style type="text/css"">
 img, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video
       {
           margin: 0;
           padding: 0;
           border: 0;
           outline: 0;
           font-size: 100%;
           vertical-align: baseline;
           background: transparent;
       }
</style>
Posted 19-Feb-13 22:36pm
Edited 19-Feb-13 22:58pm
_Amy52K
v2
Comments
vyas_pratik20 at 20-Feb-13 3:42am
   
replace img, ol, ... with body tag
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

surround the table with a div tag and name that div to a class or id like
and access that test class in css
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

this way...
if your div have class='div1' then
 
style ...
 .div1 img,.div1 ol,.div1 ul.......{...}
Happy Coding!
Smile | :)
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3


you can use Class Selector or ID Selector like....
<style type="text/css"">
div.Mydiv
{
           margin: 0;
           padding: 0;
           border: 0;
           outline: 0;
           font-size: 100%;
           vertical-align: baseline;
           background: transparent;
       }
</style>
here Mydiv is class attribute of your div............
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.150302.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100