• 0

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


Question

Posted · Report post

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

12 answers to this question

  • 0

Posted · Report post

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

2 people like this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

:)

 

 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi dominiclane

Dominic, the class is

makestuffinsidefullwidth

without the dot

;)

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now