Results 1 to 4 of 4

Thread: article image css targeting (SOLVED)

  1. #1
    User
    Join Date
    07-20-09.
    Location
    Middlesbrough - United Kingdom
    Posts
    95

    Default article image css targeting (SOLVED)

    hey i am trying to apply some code to an image in an article depending on which alignment i have chosen.

    i can traget the image using
    Code:
    .ce_text img {}
    but i cannot target the image depending where is it on the page... typolight seems to create a style and add it to it when i look at the code it has a div of
    Code:
    .image_container float_right
    or
    Code:
    .image_container float_left
    is there a way i can traget these in my css to add styling to them so i do not have to put in the margins each time i want to add an image to the page.

    Thanks,
    Ste.

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Re: article image css targeting

    Just add this css class to one of your stylesheets:

    Code:
    .float_right {
    margin: 0 0 20px 20px;
    }

  3. #3
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: article image css targeting

    Additionally to be sure to only target the images you can also use the following selector
    Code:
    .image_container.float_right {
    /* style here */
    }
    Unfortunately IE6 does not understand this. That's about 20% (and dropping) of all browsers right now?

  4. #4
    User
    Join Date
    07-20-09.
    Location
    Middlesbrough - United Kingdom
    Posts
    95

    Default Re: article image css targeting (SOLVED)

    hey,

    thanks, that works great. i had put a space inbetween them which explains why it didnt work.

    I checked it in all major browsers and IE6 and it seems to work fine.

    Thanks again

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •