[Resolved] Adding image borders

Home Forums Support [Resolved] Adding image borders

Home Forums Support Adding image borders

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #930187
    ch1800

    How to add simple borders for all images with CSS please?
    (not using a page builder)

    #930427
    David
    Staff
    Customer Support

    Hi there,

    try this CSS – it applies to all images within the page, so it won’t effect logos in your header:

    #page img {
        border: 4px solid #000 !important;
        box-shadow: border-box;
    }
    #930558
    ch1800

    Great, many thanks!

    #930564
    David
    Staff
    Customer Support

    You’re welcome

    #946847
    ch1800

    Hi David, I’m using the above in custom CSS and works fine with all images in posts.

    Now, I just want to EXCLUDE it from a particular page where I don’t want borders.
    Is it possible to achieve this by running the Simple CSS plugin that allows having specific CSS for each page and thus disabling this CSS there?

    Or rather create a new class “no borders” that blocks the border CSS and that I can use for specific images only in their properties?

    #947112
    Leo
    Staff
    Customer Support

    If you just want to exclude one page, then you can actually modify David’s CSS to this:

    body:not(.page-id-xxx) #page img {
        border: 4px solid #000 !important;
        box-shadow: border-box;
    }

    And change the xxx to the actual ID of the page.

    Let me know 🙂

    #947125
    ch1800

    Thanks Leo but this doesn’t seem to work.
    I tested with different post IDs but none worked.

    I edited my question above while you were replying and maybe the last sentence is something easier to perform?

    “Or rather create a new class “no borders” that blocks the border CSS and that I can use for specific images only in their properties?”

    #947137
    Leo
    Staff
    Customer Support

    My CSS would be the best way – otherwise I wouldn’t have suggested it.

    Can you link me to a page with the CSS added that’s not working?

    #947539
    ch1800

    Sorry, still on local host.

    #947543
    Leo
    Staff
    Customer Support

    Sorry but it’s really impossible for me to tell why it’s not working without seeing the site live.

    Maybe we can revisit the issue when it’s live?

    #947545
    ch1800

    OK, that’s fine then. Nothing urgent.
    Thanks for your kind help!

    #947572
    Leo
    Staff
    Customer Support

    No problem!

    Just comment here again when you have the site live 🙂

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.