Properties for elements inside a specific element

Discussion in 'CSS' started by pr0xy122, Dec 23, 2006.

  1. #1
    how do I specify the properties of an element inside an element. Ok let me give you an example.

    I have a table, and I want all the images inside that table to carry a border. What would be the code for this?

    cheers, proxy.
     
    pr0xy122, Dec 23, 2006 IP
  2. phree_radical

    phree_radical Peon

    Messages:
    563
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Give the table an id attribute:
    <table id="tableihave">
    Code (markup):
    Then, you can define the style rule for its images (usually in the <head></head>):
    <style>#tableihave img { border: 1px solid black; }</style>
    Code (markup):
    Does that help?
     
    phree_radical, Dec 23, 2006 IP
  3. pr0xy122

    pr0xy122 Peon

    Messages:
    1,649
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok cheers, thats what I needed to know.
     
    pr0xy122, Dec 23, 2006 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Don't forget that if you embed the stylesheet inside the HEAD element, you have to declare the type and attribute as well:
    
    <style type="text/css">
        /* style rules go here */
    </style>
    
    HTML:
     
    Dan Schulz, Dec 24, 2006 IP