Jump to content

Archived

This topic is now archived and is closed to further replies.

dominiclane

100% Browser Width Items CSS - make any div 100% of screen

Recommended Posts

dominiclane

Hi there, had a quick search in the forum and couldn't find anything..

 

I'm trying to make a div 100% of the browswer width, so I have a div, for a posts grid but am interested in the css for any div I place in the dms framework

 

This is the page for this example ..

http://www.sbcreativeco.com/

 

This is the specific div

.uber-grid-filters

 

Where it says .. ALL DESIGN PRINT

 

 

I'm trying to make it stretch 100% of the screen without making the page width 100% of the screen

I understand it can be done just in css, I have googled loads of tutorials which make sense btu none of them work??

Is there something specific I need to do with pagelines to get a div to span the full screen width?

 

Any help or a link to an article on here greatly appreciated!

 

 

Kind thanks

Dominic

Share this post


Link to post
Share on other sites
batman

Hi dominiclane

If I understand you....

I do this, please you add this CSS rules ( l saw this from http://www.pagelinestheme.com/make-content-width-section-full-width )

 

/*- SECTION FULL WIDTH-*/

/*- overriding dms/dms/less/pl-structure.less-*/

/*-body.display-boxed #site .boxed-wrap .pl-area.makestuffinsidefullwidth .pl-area-wrap > .pl-content-*/

body.display-boxed #site .boxed-wrap .pl-area.makestuffinsidefullwidth .pl-area-wrap > .pl-content {

  padding-left: 0px;

  padding-right: 0px;

}

 

/*-body.display-full #site .pl-area.makestuffinsidefullwidth .pl-content -*/

body.display-full #site .pl-area.makestuffinsidefullwidth .pl-content {

  max-width: none;

}

 

/*- optional to remove section padding from the sections you put inside-*/

body #site .pl-area.makestuffinsidefullwidth .pl-section .pl-section > .pl-section-pad {

  padding: 0px;

}

 

Then add this Custom Styles Classes at Set Area Padding

 

makestuffinsidefullwidth

 

http://screencast.com/t/e4d59ZjrAwi

 

I hope that is what you need

:)

 

 


Life is too short to remove USB safely ...

Share this post


Link to post
Share on other sites
dominiclane

Thanks for such a fast reply! Will try this

This will make the whole page full width right?

I use other content building software inside the post / content section of dms and just want one single div with a .class inside that to go full width if that's useful

 

Will try and post results so if is useful to others can see

 

Cheers!

Dominic

Share this post


Link to post
Share on other sites
dominiclane

Sorry!! I see, I add the class .makestuffinsidefullwidth to the div I want full width .. my bad!! Will try now .. cheers

Share this post


Link to post
Share on other sites
dominiclane

Didn't work .. kind thanks for the suggestion though

Share this post


Link to post
Share on other sites
batman

Hi dominiclane

Dominic, the class is

makestuffinsidefullwidth

without the dot

;)


Life is too short to remove USB safely ...

Share this post


Link to post
Share on other sites
dominiclane

It didn't work .. I found something really cool if anyone else wants to copy it

 

So simple, have been looking for this for ages!

 

.divyouwantfullwidth{

    position: relative !important;
    width: 100vw !important;
    left: calc(-50vw + 50%) !important;
}

 

It calculates the viewport width for varying sizes all in css, no js

 

:D

Share this post


Link to post
Share on other sites
jmad

dominiclane

 

Cool.  How did you use that code in your site...what specific area and how did it handle browser window transition?

 

Looks like you were implementing MegaMain menu in your DMS site.  How did that work?  Could you place anywhere or just at top?

Share this post


Link to post
Share on other sites
dominiclane

Yeah, that code works great! I had a div with a class and I just assigned that to it and it did the trick! also when you resize the window it recualculates / renders so always works

 

//

 

mega main menu - i use pagelines PL NextBox Section plugin and drop it into the dms header, you can add php code that mega main menu generates for each menu into pl nextbox and tick the box to make it run php. I can code but is nice when you can do stuff mainly gui then is better for when updates of themes and plugins come out because it all still works :D

 

LEt me know if you get stuck with pl nextbox and mega menu

Share this post


Link to post
Share on other sites
Danny

Please be aware that calc isn't standard yet and may change in the future it is also, buggy in some browsers and others do not even support it.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
dominiclane

Ok cheers, thanks for the heads up

Will check what it doesn and doesn't work in

As long as it works on firefox / chrome / safari / iphone / ipad / android is ok! :D

 

But cheers, didn't know that

Could have been embarrasing

Share this post


Link to post
Share on other sites

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I have noticed that my primary sidebar becomes intermittently invisible when browsing through various blog articles on michaelkummer.com/blog.
      See:
      https://www.dropbox.com/s/z646sgoa3mfjl1j/Screenshot 2018-07-12 15.57.46.jpg?dl=0 and https://www.dropbox.com/s/vdledzzgginvwgv/Screenshot 2018-07-12 15.57.57.jpg?dl=0
      Upon refresh, the sidebar appears. I have been using the following CSS code to hide the sidebar on mobile without any issues. 
      @media only screen and (max-width: 993px) {
      /* hide sidebars */
           .plsb {
              display: none !important;
          }
      }
      I tried to add the following CSS to force the sidebar to show on screens that are wider than 994 pixels but to no avail. Any clue what could be causing this issue?
    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I am using the LESS/CSS Pagelines extension and tried to add the following code to make use of FontAwesome:
      a.c2a:before {
          content: "\f07a\00a0";
          font-family: "Font Awesome 5 Pro";
          Font-weight: 900;
          font-style: normal;
          font-weight: normal;
          text-decoration: inherit;
          padding-left: 4px;
      }
       
      The issue is that as soon as I have the CSS via the Custom Styling text box, Pagelines (or the extension) strips out the backslashes (\). As a result, I had to abandon the CSS/LESS extension and instead add all my CSS code to a separate .css file.
      Is there a fix or workaround for this?
      Thanks
      Michael
    • glyph.marketing
      By glyph.marketing+
      Hello, I am having a problem similar to that experienced by Michael Kummer here. We have pages that show this automatic scrolling issue (examples here and here) and it is sufficiently annoying that we have seen customers bounce while trying to convert. Strangely, it only happens at specific resolutions, so it can be difficult to reproduce. In general we can only consistently reproduce it on a 4k resolution with a browser width between 1517 and 1536px. 
      Thanks to Michael Kummer's help we were able to set the overflow-anchor property to none in the entire body, which fixed the issue as far as we can tell, but also obviously disabled scroll anchoring for the whole site. I tried applying it to the specific element that looked like it was being reloaded, which was the PL Meganav extension, but that was unsuccessful. 
      Can anyone help us figure out which element or ID we can apply this property to, so that we can fix the scrolling issue but not disable scroll anchoring for the entire site?
      Thank you - 
      Glyph Language Services
    • chamois_blanc
      By chamois_blanc+
      Hello,
      Shouldn't the image PL5 component be using the srcset/picture css directives to pick the correct size for an image? or it does already and I don't know how to use it? Thank you for any advice or enlightenment.
    • Dan Haddock
      By Dan Haddock
      Plugins Active and installed: 
      Akismet Anti-Spam
      Coming Soon Page & Maintenance Mode by SeedProd
      Contact Form 7
      Cookie Law Info
      DMS Professional Tools  
      Enhanced Media Library  
      Flamingo
      Google Analytics for WordPress by MonsterInsights
      Google XML Sitemap
      Jetpack by WordPress.com
      Legull 
      Loginizer   
      MailChimp for WordPress
      PageLines Updater    
      Schema App Structured Data 
      Sucuri Security - Auditing, Malware Scanner and Hardening
      Uber reCaptcha    
      Yoast SEO
      Wordpress Version: 4.8.1
      Pagelines Version: 2.2.4
       
      Good Evening/Afternoon or Morning, 
      I am running into a problem with CSS styling not applying inside of most browsers (Safari, Firefox) when I am logged in to wordpress, and all browsers that I have tested when I am logged off and the site has been made public (Chrome, Firefox and Safari).
      As a result, I have managed to identify the probable cause. It looks as though these browsers are refusing to render my sites compiled CSS file due to it being a HTTP URL rather than HTTPS.
      I have attempted to change this URL to HTTPS in my browser, however it brings back an ERROR: File not found page - https://www.shortfilmblog.com/wp-content/uploads/pagelines/compiled-css-core-1505847507.css
      What would you suggest in this regard? Would this be resolvable from your end?
      Happy to provide any further details required.
×