igloobob
asked on
Break a div out of its container with media query
Hello,
How can I break a div out of it's container div at smaller screen sizes with @mediaquery?
I have a nav box and also a title panel that overlays a responsive image carousel. On smaller devices such as the iPhone, the nav and title obscure too much of the image so I want them to break out and come above (nav) and below (title) the carousel.
The carousel is responsive so I can't position the title box absolutely I don't think?
<div id="slider-container">
<div id="nav-container">
<nav-bar>
<ul>
<li><a href="commercial_grounds_m aintenance .html">COM MERCIAL GROUNDS MAINTENANCE</a></li>
<li><a href="private_garden_maint enance.htm l">PRIVATE GARDEN MAINTENANCE</a></li>
<li><a href="garden_design.html"> GARDEN DESIGN</a></li>
<li><a href="landscaping.html">LA NDSCAPING< /a></li>
<li><a href="forestry.html">FORES TRY</a></l i>
</ul>
</nav-bar>
<div id="text-box">
<h1>CREATING HORTICULTURAL EXCELLENCE FOR OVER 30 YEARS</h1>
</div>
</div>
<div class="slider-wrapper theme-default">
<div id="slider" class="nivoSlider">
<img alt="" src="images/home-pics/Home 1.jpg" />
<img alt="" src="images/home-pics/Home 2.jpg" />
<img alt="" src="images/home-pics/Home 3.jpg" />
</div>
</div><!-- end slider -->
</div>
How can I break a div out of it's container div at smaller screen sizes with @mediaquery?
I have a nav box and also a title panel that overlays a responsive image carousel. On smaller devices such as the iPhone, the nav and title obscure too much of the image so I want them to break out and come above (nav) and below (title) the carousel.
The carousel is responsive so I can't position the title box absolutely I don't think?
<div id="slider-container">
<div id="nav-container">
<nav-bar>
<ul>
<li><a href="commercial_grounds_m
<li><a href="private_garden_maint
<li><a href="garden_design.html">
<li><a href="landscaping.html">LA
<li><a href="forestry.html">FORES
</ul>
</nav-bar>
<div id="text-box">
<h1>CREATING HORTICULTURAL EXCELLENCE FOR OVER 30 YEARS</h1>
</div>
</div>
<div class="slider-wrapper theme-default">
<div id="slider" class="nivoSlider">
<img alt="" src="images/home-pics/Home
<img alt="" src="images/home-pics/Home
<img alt="" src="images/home-pics/Home
</div>
</div><!-- end slider -->
</div>
ASKER
it already is absolutely positioned to get it sit int he right place over the carousel. If I make it fixed below the required screensize it won't work because I don't know the height of the carousel (due to it being responsive) so I can't know the exact distance I need it from the top of the page.
Unless I am missing something (quite likely!)?
Unless I am missing something (quite likely!)?
Sounds like you are going to have to look at a scripted solution.
Try JQuery and trap the resize window event. You can then calculate the height of the carousel and position accordingly.
Try JQuery and trap the resize window event. You can then calculate the height of the carousel and position accordingly.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In your media specific stylesheet (below a certain size) position the div absolutely or fixed.