• pfree5891

    (@pfree5891)


    Hello,

    I am trying to get my header element and images/boxes in rows throughout my page to go all of the way to the edge of the page, but they automatically have margins on the left and right sides. What do I need to do to fix this? Can I make edits within the page itself or do I have to do it with CSS?

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    It really depends on your theme, some are more conducive to CSS changes than others. Some require HTML changes to accomplish some things well. The way most themes structure pages is not conducive to content out to the viewport edge. Most page content is typically within an overall content container which has limited width and established margins.

    To get such content to run to the edge, you have to resort to CSS tricks like widths over 100% and negative margins, often involving calc() dimensions. Not ideal.

    The alternative is to restructure the HTML used on the templates. Custom templates can be stored in a child theme to keep them safe from theme updates. Changes like this can be pretty major with some themes. Sometimes to the point where it’d be easier to work from a basic starter theme instead of a fully developed theme.

    Thread Starter pfree5891

    (@pfree5891)

    Thank you. So does this mean I am out of luck with my current theme? It seems that it is possible for images to go to the edge of my page, as can be seen on the home page of the website (see Revolution Slider banner at the top): https://www.pucschools.org/

    Moderator bcworkz

    (@bcworkz)

    I wouldn’t say you’re out of luck, only that it may take more effort to accomplish what you want. The Rev slider is within a “full-width” container, which does let content fill to the edge. OTOH, the page linked in your OP has a set width with margins, so it takes greater effort to fill out to the edge. The solution is sub-optimal but not impossible. For example, for a div that normally fits within the margins with a 950px width, it might be styled to fill to the edges with

    width: 100vw;
    margin-left: calc(475px - 50vw);

    To do this with the blue “Want to learn more?” box near the bottom, add this CSS:

    .vc_custom_1583271426948 {
      width: 100vw;
      margin-left: calc(475px - 50vw);
    }

    This only applies to normal 1200px max desktop views. Similar measures are needed for other screen media queries.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I get rows (images/boxes) to go to the edge of the page?’ is closed to new replies.