Why the img-responsive combined to pull-right does not scale properly on mobile devices?
I have the following code:
<div class="row">
<div class="container">
<div class="pull-right">
<a class="fancybox thumbnail" rel="features" href="test_image_small.jpg">
<img class="img-responsive" src="test-image.jpg"})">
</a>
</div>
<h2>Key Features</h2>
<br />
<ul>
<li>Feature A</li>
<li>Feature B</li>
<li>Feature C</li>
<li>Feature D</li>
</ul>
</div>
</div>
I've already checked this question but it doesn't help in my case.
Here is the live sample: http://www.bootply.com/zbY6BrDbWI
Thanks.
Not sure I can directly help, I've always hated using the pull-left/right classes for this very reason. I tend to just stick with using Bootstraps Grid System and ordering the elements properly. For example;
<div class="container">
<div class="row">
<div class="col-sm-4">
<h2>Key Features</h2>
<br>
<ul>
<li>Feature A</li>
<li>Feature A</li>
<li>Feature A</li>
<li>Feature A</li>
</ul>
</div>
<div class="col-sm-8">
<a class="fancybox thumbnail" rel="features" href="http://placehold.it/800x600.jpg">
<img class="img-responsive" src="http://placehold.it/800x600.jpg">
</a>
</div>
</div>
</div><!-- /.container -->
(Note I've removed the nav HTML and cleaned up the code a bit)
If you absolutely needed them in the order you specified (in order to force the image to be the at the top on mobile for example) you could always apply the pull-right to the grid, like this
<div class="container">
<div class="row">
<div class="col-sm-8 col-xs-12 pull-right">
<a class="fancybox thumbnail" rel="features" href="http://placehold.it/800x600.jpg">
<img class="img-responsive" src="http://placehold.it/800x600.jpg">
</a>
</div>
<div class="col-sm-4">
<h2>Key Features</h2>
<br>
<ul>
<li>Feature A</li>
<li>Feature A</li>
<li>Feature A</li>
<li>Feature A</li>
</ul>
</div>
</div>
</div><!-- /.container -->
Notice on this one how I also applied the col-xs-12 class. This forces it into knowing it's width and fitting the image into the parent container.
DEMO JSFiddle 1
DEMO JSFiddle 2
Hope this helps.
Related
I am using the Bootstrap Grid System in order to make this list (3 columns) responsive. I am also using this with react.
The goal is that on large screens, I can fit all 3 columns in one row. On medium screens I fit two columns in one row and the last one in the last row. On very small screens I fit each column in one row.
It is working, however it is not pushing the columns on each row, its rather overflowing.
What am I missing?
<div className="container-fluid">
<div className="row">
<div className="col-xs-12 col-sm-6 col-md-3">
<div className="col-tab">
<h4>Heading 1</h4>
<ul>
<li>test1</li>
<li>test2</li>
</ul>
</div>
</div>
<div className="col-xs-12 col-sm-6 col-md-3">
<div className="col-tab">
<h4>Heading 2</h4>
<ul>
<li>test 3</li>
<li>test 4</li>
</ul>
</div>
</div>
<div className="col-xs-12 col-sm-6 col-md-3">
<div className="col-tab">
<h4>Heading 3</h4>
<ul>
<li>Test4</li>
<li>TEst 5</li>
</ul>
</div>
</div>
</div>
</div>
I have some icons that have a rollover.
http://devjohnson.com/faq
If you go to the top right and roll over the FB or the TW icons, you will see the rollover shows up like 10 pixels and the rest is behind the grey layer. I cant figure out how to get it to come to the front. I have tried z-index on many different layers and none of them are revealing the full rollover.
Any help would be great.
Thanks!
Caroline
I inspected the code in chrome and it looks like there are no sub-menus for the last three icons. the code as you have it is as follows (copied from chrome inspector view source:
<!--<div class="soc_med ten columns omega">-->
<div class="soc_med">
<div style="float:right; height:100px; margin-top:12px; vertical-
align:top; overflow:hidden;">
<div id='wrap'>
<div id="clickable_div_fb"><a
href="https://www.facebook.com/TheOriginalDoc" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/facebook_icon.png" id="fb" /></a>
<div id="nav_menu_fb">
<ul>
<li><a
href="https://www.facebook.com/TheOriginalDoc"
target="_blank">DocJohnson</a></li>
<li><a
href="https://www.facebook.com/askthedocshow" target="_blank">Ask The
Doc</a></li>
</ul>
</div>
</div>
<div id="clickable_div_tw" class="tw"><a
href="https://twitter.com/theoriginaldoc" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/twitter_icon.png"
id="socialImage" /></a>
<div id="nav_menu_tw">
<ul>
<li><a href="https://twitter.com/theoriginaldoc"
target="_blank">DocJohnson</a></li>
<li><a href="https://twitter.com/askthedocshow"
target="_blank">Ask The Doc</a></li>
</ul>
</div>
</div>
<div id="clickable_div_ig" class="ig"><a
href="http://instagram.com/docjohnsonusa" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/instagram_icon.png" /></a>
</div>
<div id="clickable_div_tu" class="tu"><a
href="http://docjohnsonusa.tumblr.com/" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/tumblr_icon.png" id="socialImage"
/></a>
</div>
<div id="clickable_div_yt" class="yt"><a
href="https://www.youtube.com/user/DOCJOHNSON1976" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/youtube_icon.png" /></a>
</div>
</div>
</div>
in the code within the "clickable_div" for the FB and TW icons, there is another div called "nav_menu" which contains the links to the ask doc and Doc Johnson pages. The instagram, tumbler and YouTube "clickable_div" tags do not contain this div.
I suggest trying the following for this section in your code:
-->
<div class="soc_med">
<div style="float:right; height:100px; margin-top:12px; vertical-
align:top; overflow:hidden;">
<div id='wrap'>
<div id="clickable_div_fb"><a
href="https://www.facebook.com/TheOriginalDoc" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/facebook_icon.png" id="fb" /></a>
<div id="nav_menu_fb">
<ul>
<li><a
href="https://www.facebook.com/TheOriginalDoc"
target="_blank">DocJohnson</a></li>
<li><a
href="https://www.facebook.com/askthedocshow" target="_blank">Ask The
Doc</a></li>
</ul>
</div>
</div>
<div id="clickable_div_tw" class="tw"><a
href="https://twitter.com/theoriginaldoc" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/twitter_icon.png"
id="socialImage" /></a>
<div id="nav_menu_tw">
<ul>
<li><a href="https://twitter.com/theoriginaldoc"
target="_blank">DocJohnson</a></li>
<li><a href="https://twitter.com/askthedocshow"
target="_blank">Ask The Doc</a></li>
</ul>
</div>
</div>
<div id="clickable_div_ig" class="ig"><a
href="http://instagram.com/docjohnsonusa" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/instagram_icon.png" /></a>
<div id="nav_menu_ig">
<ul>
<li><a
href="https://www.instagram.com/TheOriginalDoc"
target="_blank">DocJohnson</a></li>
<li><a
href="https://www.instagram.com/askthedocshow" target="_blank">Ask The
Doc</a></li>
</ul>
</div>
</div>
<div id="clickable_div_tu" class="tu"><a
href="http://docjohnsonusa.tumblr.com/" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/tumblr_icon.png" id="socialImage"
/></a>
<div id="nav_menu_tu">
<ul>
<li><a
href="https://www.tumbler.com/TheOriginalDoc"
target="_blank">DocJohnson</a></li>
<li><a
href="https://www.tumbler.com/askthedocshow" target="_blank">Ask The
Doc</a></li>
</ul>
</div>
</div>
<div id="clickable_div_yt" class="yt"><a
href="https://www.youtube.com/user/DOCJOHNSON1976" target="_blank"><img
src="/skin/frontend/dJTheme/default/images/youtube_icon.png" /></a>
<div id="nav_menu_yt">
<ul>
<li><a
href="https://www.youtube.com/TheOriginalDoc"
target="_blank">DocJohnson</a></li>
<li><a
href="https://www.youtube.com/askthedocshow" target="_blank">Ask The
Doc</a></li>
</ul>
</div>
</div>
</div>
</div>
I'm trying to vertically and Horizontally center the list-group to the left of the image in the below code.
<div class="jumbotron">
<div class="row">
<div class="col-lg-6">
<ul class="list-group center-list">
<li class="list-group-item">something here</li>
<li class="list-group-item">something here</li>
<li class="list-group-item">something here</li>
</ul>
</div>
<div class="col-lg-6">
<img src="images/ModelBack.png" class="pull-right">
</div>
</div>
I created the center-list class and have tried following a number of examples with similar questions, but my CSS is apparently lacking.
This worked for me:
<div class="jumbotron">
<div class="container">
<div class="row">
<div class="col-md-6">
<h1>Big Test</h1>
<h2>Little Test</h2>
</div>
<div class="col-md-6">
<img src="img.jpg" />
</div>
</div>
</div>
</div>
you are missing a closing tag on jumbtron maybe that is the problem,
<div class="jumbotron">
<div class="row">
<div class="col-lg-6">
<ul class="list-group center-list">
<li class="list-group-item">something here</li>
<li class="list-group-item">something here</li>
<li class="list-group-item">something here</li>
</ul>
</div>
<div class="col-lg-6">
<img src=""></img>
</div>
</div>
</div>
try now ;)
I have started using Foundation4 CSS framework for designing and developing A repsonsive page.
I am struggling with the footer(div),on Desktop it the div with class="small-12 coulms" settles at the bottom
but however when I am trying to reduce the browser screen size for mobile the bottom div is coming up in between other divs rather than occupying the footer position.
This is my code, Any assistance how I can restrict the footer
using the Foundation 4 CSS framework methods will help me a lot in using the framework.
<div id="header" class="row">
<div id="logo" class="large-3 columns">
<img src="img/logo-header.gif" />
</div>
<div id="slogan" class="large-3 columns">
<span class="slogan">AAAAAAAAAAAAAAAAAAA
<sup style="font-size: 13px;font-family: Arial;">*</sup>,
BBBBBBBBBBBBBBBBB
</span>
</div>
<div id="search" class="large-5 columns">
<div class="large-12 columns hide-for-small">
<ul class="topLinks">
<li>Contact us</li>
<li>Careers</li>
<li>Research & Tools</li>
<li class="noBorder">About </li>
</ul>
</div>
<div class="large-12 columns">
<div class="small-8 columns">
<input type="text" />
</div>
<div class="small-4 columns">
Search
</div>
</div>
</div>
</div>
</div>
<div class="small-12 large-12 columns">
<div class="row">
<nav class="top-bar">
<ul class="title-area">
<!-- Title Area -->
<li class="name"><h1> Home </h1></li>
<!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<!-- Left Nav Section -->
<ul class="left">
<li class="divider"></li>
<li class="active has-dropdown">Experience the difference
<ul class="dropdown">
<li >Why We</li>
<li>Getting Started</li>
</ul>
</li>
<li class="divider"></li>
<li class="divider"></li>
<li class="has-dropdown">How Can We Help You
<ul class="dropdown">
<li >Our Unique Aprroach</li>
<li>Our Offerings</li>
<li>Financial Products</li>
</ul>
</li>
<li class="divider"></li>
<li class="divider"></li>
<li>Have An Advisor Contact You</li>
<li class="divider"></li>
</ul>
<!-- Right Nav Section -->
<ul class="right">
<li>My Account
</ul>
</section>
</nav>
</div>
</div>
<div class="small-12 large-12 columns">
<div id="mainSection" class="row" style="background:blue">
<div id="left" class="large-3 columns" style="background:#8DBC8F" >
<div id="leftFirst" class="large-12 columns" style="background:#F08080"><h3>News and Features </h3></div>
<div id="leftSecond" class="large-12 columns" style="background:#E6E6FA"><h3> About </h3></div>
</div>
<div id="right" class="large-9 columns" style="background:#008B8B">
<div id="rightContainer" class="row">
<div id="leftFirst" class="large-12 columns" style="background:#DAA520"> </div>
<div id="leftSecond" class="large-12 columns" style="background:#7B68EE">
<div id="welcome" class="row">
<div id="image" class="large-12 columns"><h3>Welcome TO </h3> </div>
<div id="about" class="large-12 columns">
<div id="welcome" class="row">
<div id="about1" class="large-4 columns"><h6>EEEEEEEEEEEEE</h6> </div>
<div id="about2" class="large-4 columns"> <h6>Our Unique Aprroach</h6> </div>
<div id="about3" class="large-4 columns"><h6>Our Offerings</h6> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="footer" class="large-12 columns">
nithkincdbjcbdsj
</div>
</div>
</div>
</div>
I would have the footer as its own class="row", personally. I believe the class applies a clearfix so it stays on its own.
Not sure if you have this resolved. I noticed in your example code above, there are many nested columns that are not contained by an element with the class "row".
<div class="row">
<div class="large-12 columns">
<div class="row">
<div class="large-eight columns">
<div class="row">
<div class="large-12 columns"></div>
</div>
</div>
<div class="large-4 columns"></div>
</div>
</div>
</div>
It is my understanding that this is necessary for the columns to work correctly.
Someone correct me if I'm misunderstanding the docs.
To build nav tabs via Bootstrap, it's simple, I just add code:
<ul class="nav nav-tabs">
<li class="active">
Home
</li>
<li>Tab1</li>
<li>Tab2</li>
</ul>
http://jsfiddle.net/M4YZ6/
but it's only top part of the tabs, who knows how to build bottom part using bootstrap like on picture below:
Thanks a lot!
try this
http://jsfiddle.net/M4YZ6/5/
HTML
<div class="tabbable">
<ul class="nav nav-tabs" id="myTab">
<li class="active">
<a data-original-title="" rel="tooltip" href="#tab1" data-toggle="tab">Home</a>
</li>
<li><a data-original-title="" rel="tooltip" href="#tab2" data-toggle="tab">Profile</a></li>
<li><a data-original-title="" rel="tooltip" href="#tab3" data-toggle="tab">Message</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="tab1">
Home
</div>
<div class="tab-pane" id="tab2">
Profile
</div>
<div class="tab-pane" id="tab3">
Message
</div>
</div>
</div>
I believe Tabbable nav is what you are looking for,
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active">Section 1</li>
<li>Section 2</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<p>I'm in Section 1.</p>
</div>
<div class="tab-pane" id="tab2">
<p>Howdy, I'm in Section 2.</p>
</div>
</div>
</div>
Markup taken from the nav component documentation
===Edit===
Js fiddle