Just felt if this issue can be resolved with any css tweaks.
I have a row with Col -8 and Col -4 in it, Col -4 has the following 4 grid images in it with two rows again in it
<div class="col-md-4">
<div class="row">
<div class="col-md-6">
<div class="four">
<img src="images/home/client1.png" style="width:100% ; height:160px" alt="Devegowda">
<div class="four-overlay top">
<p style="font-weight: bold">HD Devegowda</p>
<br /> Former Prime Minister of India (1996)
<br />
<a class="button_example" href="#">Read</a>
</div>
</div>
<!-- <br />-->
</div>
<div class="col-md-6">
<div class="four">
<img src="images/home/client1.png" style="width:100% ; height:160px" alt="Devegowda">
<div class="four-overlay top">
<p style="font-weight: bold">HD Bhawani</p>
<br /> Former Prime Minister of India (1996)
<br />
<a class="button_example" href="#">Read</a>
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-6">
<div class="four">
<img src="images/home/client1.png" style="width:100% ; height:160px" alt="Devegowda">
<div class="four-overlay top">
<p style="font-weight: bold">HD Revanna</p>
<br /> Former Prime Minister of India (1996)
<br />
<a class="button_example" href="#">Read</a>
</div>
</div>
<!-- <br />-->
</div>
<div class="col-md-6">
<div class="four">
<img src="images/home/client1.png" style="width:100% ; height:160px" alt="Devegowda">
<div class="four-overlay top">
<p style="font-weight: bold">HD Kumaraswamy</p>
<br /> Former Prime Minister of India (1996)
<br />
<a class="button_example" href="#">Read</a>
</div>
</div>
</div>
</div>
</div>
It appears like this when I minimize the screen to check its mobile compatibility but it looks ugly as two images in each row getting merged like this, I feel it will be much better if there is a small padding between two images here, any help ?
From what I understand, you will need to also specify the classes for different devices (col-sm-X and col-xs-X for tablets and phones).
If you prefer not to do that ... the COL-MD will be equal to COL-XS-12 no matter of its size.
So in order to display your images properly... you should add the class col-xs-4 or 6 for each image parent that already has the class: col-md-6 .
Hope it helps.
From the bootstrap docs, try
<img src="..." class="img-responsive" alt="Responsive image">
http://getbootstrap.com/css/#images
Related
I am having some difficulties. I am developing a website and am having issues with the social link icons going tiny when the screen size is reduced. I'd like to use media queries to specify the size for smaller screens - what I am trying is not working.
Social links at top of page:
`<div class="container">
<div class="row-1">
<!--First column-->
<div class="col-sm-3">
<img src="images/fbGrey.png" class="img-responsive"
style="width:50px" alt="Find us on Facebook">
<hr class="vertical"/>
</div>
<!--Second column-->
<div class="col-sm-3">
<img src="images/twitterGrey.png" class="img-responsive"
style="width:50px" alt="Follow us on Twitter">
<hr class="vertical"/>
</div>
<!--Third column-->
<div class="col-sm-3">
<img src="images/instagramGrey.png" class="img-responsive"
style="width:50px" alt="Follow us on Instagram">
<hr class="vertical"/>
</div>
<!--Fourth column-->
<div class="col-sm-3">
<img src="images/pinterestGrey.png" class="img-responsive"
style="width:50px" alt="Follow us on Pinterest">
<hr class="vertical"/>
</div>
</div>
</div>`
Social links in footer:
`
<!--First column-->
<div class="col-md-3">
<!--Social buttons-->
<!--First column-->
<div class="container">
<div class="row-3">
<div class="col-sm-3">
<img src="images/fbGrey.png" class="img-responsive"
style="width:70px" alt="Find us on Facebook" id="fb">
<img src="images/twitterGrey.png" class="img-responsive"
style="width:70px" alt="Follow us on Twitter">
<img src="images/instagramGrey.png" class="img-responsive"
style="width:70px" alt="Follow us on Instagram">
<img src="images/pinterestGrey.png" class="img-responsive"
style="width:70px" alt="Follow us on Pinterest">
</div>
</div>
</div>`
Additionally, within the footer the height of <div class="footer-copyright">
increases when the screen size is reduced - anybody know why this is happening? I would also like to use media queries to fix this but it doesn't seem to work.
`<!--footer-->
<div class="span4">
<!-- empty, but using spacer to prevent collapse -->
<div class="spacer10"></div>
</div> </div>
<!--Second column-->
<div class="col-md-3">
<h5 class="title">OUR SERVICES</h5>
<p>Treatments</p>
<p>Bookings</p>
<p>Shop</p>
</div>
<!--First column-->
<div class="col-md-3">
<h5 class="title">COMPANY</h5>
<p><a href=index.html>Home</a></p>
<p>Location</p>
<p>Contact</p>
<p>Privacy Policy</p>
</div>
<!--Second column-->
<div class="col-md-3">
<h5 class="title">CONTACT</h5>
<strong>Hands on Sports & Holistic Therapy</strong><br>
50 Westonfields<br>
Bridgetown<br>
Totnes<br>
TQ90 5QX<br>
<abbr title="Phone">P: 07450232531</abbr><br><br>
</address>
<address>
<strong>Email: </strong><br>
jo#handson-therapy.com
</address>
</div>
</div>
</div>
<hr>
<!--Copyright-->
<div class="container">
<div class="row-5">
<div class="col-sm-12">
<div class="footer-copyright">
<div class="container-fluid">
<center>© 2017 Copyright: Hands on Sports & Holistic
Therapy. All rights reserved.</center>
</div>
</div>
</div>
</div>
<div class="span4">
<!-- empty, but using spacer to prevent collapse -->
<div class="spacer40"></div>
</div>
</footer>
<!--/.Footer-->`
Here is my code in JSFiddle - obvs no images present.
https://jsfiddle.net/AnnieWebDev/frrvmpnr/
Thanks for your help :)
have you tried to set min-width: 70px !important; on the img tag. This way the image will not go any smaller than the value which you set in there.
You have several errors in your code. Enter your code here and hit check and then fix the errors. html validator
Take </link> off the end of the <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"></link>
<center> is obscolete, use css. In your css style sheet you can add h1 {
text-align: center;} or inline html do it like this <h1 style="text-align:center;">Centered Heading</h1>
Try adding this in your head tag:
<meta name="viewport" content="width=device-width, initial-scale=1">
This question already has an answer here:
Bootstrap 3 - Aligning column height
(1 answer)
Closed 6 years ago.
Beginner here, I am building a one page bootstrap site, I have divided the site into sections, i have already added 1st image as the background in section one.
I have tried using the columns but no vial.
I cant get the two images side by side like shown in the prototype (http://imgur.com/a/MJQ2w).
I want the page layout to be like this with no margins but i am unable to do this with bootstrap. Please help me with your expertise.
<header style="background-image: url('static/assets/home-bg.jpg');">
<div class="intro-content">
<div class="brand-name">Learning & Experience</div>
<hr class="colored">
<div class="brand-name-subtext">Lorem Ipsum Dolor Init
</div>
</div>
<div class="scroll-down">
<a class="btn page-scroll" href="#about"><i class="fa fa-angle-down fa-fw"></i></a>
</div>
</header>
<section id="about">
<div class="container-fluid">
<div class="row row-no-gutter">
<div class="col-md-6 img-responsive">
<img src="static/assets/training.png">
</div>
<div class="col-md-6 img-responsive">
<img src="static/assets/recruit.png" >
</div>
</div>
</div>
<div>
Check my example here, Without removes any padding provide by bootstrap
HTML
<section class="values">
<div class="col-md-4 box text-white box blues">
<div class="box-home">
<h4>our values</h4>
<p>At MOCAZ PRIME, with the expertise of experienced traders, we join in giving the best advice and knowledge to individuals to ensure their financial goals can be achieved in any market conditions.</p>
<div class="icon-text">
<p>01.</p>
</div>
</div>
</div>
<div class="col-md-4 text-white box bg-city blacks">
<div class="box-home">
<h4>our philipsophy</h4>
<p>It is our ambition to keep up challenges of a dynamic and changing market. Consequently it is necessary to flexibly bring new techniques which meet the needs of our customers. This all predetermines us to achieve a leading position in the global financial advisory services.</p>
<div class="icon-text">
<p>02.</p>
</div>
</div>
</div>
<div class="col-md-4 text-white box blacks">
<div class="box-home">
<h4>our mission</h4>
<p>Our mission is to facilitate a world-class foreign exchange, metal and contracts for difference trading environment. We're dedicated to providing industry-leading technology to the international trading community and we strive to deliver educational tools and resources that enable traders to further develop their trading skills.</p>
<div class="icon-text">
<p>03.</p>
</div>
</div>
</div>
</section>
DEMO
Replace your code
<div class="col-md-6 img-responsive">
<img src="static/assets/training.png">
</div>
<div class="col-md-6 img-responsive">
<img src="static/assets/recruit.png" >
</div>
With following line of code
<div class="col-md-6">
<img src="static/assets/training.png" class=" img-responsive" />
</div>
<div class="col-md-6">
<img src="static/assets/recruit.png" class=" img-responsive" />
</div>
Fixed the issue, Thanks guys.
<section id="about">
<div class="container-fluid">
<div class="row" id="port2-second-row">
<div class="col-xs-6 imgcont" id="port2-first-col">
<img src="static/assets/training.png" alt="training" />
</div> <!-- end col-sm-6 -->
<div class="col-xs-6 imgcont" id="port2-second-col">
<img src="static/assets/recruit.png" alt="recruit" />
</div> <!-- end col-sm-6 -->
</div> <!-- end port-second-row -->
CSS :
img {
width: 100%;
height: 100%;}
.imgcont {
padding: 0px;
I have a site: http://tele-verse.com/site
Where I have a div with an image of a phone, a group photo and a quote.
I have the button "Tell me more" in a certain position relative to the image and I want to keep them in the same position when the screen size is resized to mobile.
Is there a way to lock the items in the div in place?
Here is my code:
<div class="row">
<div class="col-sm-4">
<h4>Phone Systems</h4>
<h4>for All Sized Businesses</h4>
<div class='adPhotoBtn'>
<img src='http://tele-verse.com/site/wp-content/uploads/2015/09/phone.png' alt='phone' />
<a href='http://tele-verse.com/site/contact/'><button type="button" class='adButton'>Tell Me More</button></a>
</div>
</div>
<div class="col-sm-4">
<h4>Mitel MiCollab</h4>
<h4>solutions to keep your</h4>
<h4>business connected</h4>
<div class='adPhotoBtn'>
<img src='http://tele-verse.com/site/wp-content/uploads/2015/09/Collabphoto-transparent.png' alt='collaborate' />
<a href='http://tele-verse.com/site/contact/'><button type="button" class='adButton'>Get Connected</button></a>
</div>
</div>
<div class="col-sm-4">
<img class='quote' src='http://tele-verse.com/site/wp-content/uploads/2015/09/open-quotes.png' alt='"' />
<p>I want you to know that we are very pleased with the quality of service Dan and the rest of your company provides. We sincerely appreciate your responsiveness and the way you conduct business.</p>
<img class='quote' src='http://tele-verse.com/site/wp-content/uploads/2015/09/close-quotes.png' alt='"' />
<h6>MICHAEL GEIGER</h6>
<h6>IT Manager - Precision Gear</h6>
</div>
</div>
Added div around items and set a max-width seemed to work fine.
<div class="row">
<div class="col-md-4 col-sm-4">
<div class='homeAds'>
<h4>Phone Systems</h4>
<h4>for All Sized Businesses</h4>
<div class='adPhotoBtn'>
<img src='http://tele-verse.com/site/wp-content/uploads/2015/09/phone.png' alt='phone' />
<a href='http://tele-verse.com/site/contact/'><button type="button" class='adButton'>Tell Me More</button></a>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4">
<div class='homeAds'>
<h4>Mitel MiCollab</h4>
<h4>solutions to keep your</h4>
<h4>business connected</h4>
<div class='adPhotoBtn'>
<img src='http://tele-verse.com/site/wp-content/uploads/2015/09/Collabphoto-transparent.png' alt='collaborate' />
<a href='http://tele-verse.com/site/contact/'><button type="button" class='adButton'>Get Connected</button></a>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4">
<div class='homeAds'>
<img class='quote' src='http://tele-verse.com/site/wp-content/uploads/2015/09/open-quotes.png' alt='"' />
<p>I want you to know that we are very pleased with the quality of service Dan and the rest of your company provides. We sincerely appreciate your responsiveness and the way you conduct business.</p>
<img class='quote' src='http://tele-verse.com/site/wp-content/uploads/2015/09/close-quotes.png' alt='"' />
<h6>MICHAEL GEIGER</h6>
<h6>IT Manager - Precision Gear</h6>
<div class='homeAds'>
</div>
</div>
Instead of setting up one after another, by reducing the screen images stretch unnatural (and stay in 4 columns).
I paste a piece of code with only 2 pictures, because otherwise stackoverflow blocking publication of the post.
Thanks in advance
<div class="container">
<div class="row">
<div class="col-xs-3">
<div class="viewport">
<a href="#">
<span class="dark-background" style="display: none;">Northern Saw-whet Owl <em>Photo by Matt Bango</em></span>
<img src="images/portfolio/image1.jpg" alt="Northern Saw-Whet Owl" class="img-portfolio-item" />
</a>
</div>
</div>
<div class="col-xs-3">
<div class="viewport">
<a href="#">
<span class="dark-background" style="display: none;">Northern Saw-whet Owl <em>Photo by Matt Bango</em></span>
<img src="images/portfolio/image2.jpg" alt="Northern Saw-Whet Owl" class="img-portfolio-item" />
</a>
</div>
</div>
</div>
</div>
As per your comment, if you use
<img src="images/portfolio/image3.jpg" alt="Northern Saw-Whet Owl" class="img-portfolio-item" class="img-responsive" />
it will ignore the second image tag. Instead use:
<img src="images/portfolio/image3.jpg" alt="Northern Saw-Whet Owl" class="img-portfolio-item img-responsive" />
Also, you've made the column col-xs-3 which means that it will be 4 columns from 0px. To make the image 100% width up until the first (small) breakpoint, use col-sm-3instead.
So:
...
<div class="col-sm-3">
<div class="viewport">
<a href="#">
<span class="dark-background" style="display: none;">Northern Saw-whet Owl <em>Photo by Matt Bango</em></span>
<img src="images/portfolio/image1.jpg" alt="Northern Saw-Whet Owl" class="img-portfolio-item" />
</a>
</div>
</div>
...
Use class="img-responsive" on img tags. See doc for more info
I have this site:
http://infine-traiteur.ch/
We have 4 elements on the first page (I put a picture to understand that I mean)
http://i57.tinypic.com/288silx.jpg
If we click on a particular image (the high resolution) everything works, if you resize the window and reach the mobile links these 4 elements only and do not understand why it works.
This is code HTML:
<div class="row">
<div class="carouselspaceholder"> </div>
<div class="six columns">
<div class="cro_fpc cro_fpbig">
<div class="cro_backgroundmask"> </div>
<img class="attachment-fc1 wp-post-image" alt="front (3)" src="http://infine-traiteur.ch/wp-content/uploads/2014/09/front-3.jpg" height="340" width="465">
<div class="fptitles">
<h3 class="fptitle cro_accent">
Commandez-votre service traiteur
</h3>
</div>
<div class="slidelinkspan">
Plus d'infos
</div>
</div>
<div class="cro_fpc cro_fpsmall">
<div class="cro_backgroundmask"> </div>
<img class="attachment-fc2 wp-post-image" alt="front (1)" src="http://infine-traiteur.ch/wp-content/uploads/2014/09/front-1.jpg" height="170" width="465">
<div class="fptitles">
<h3 class="fptitle cro_accent">
Nos partenaires
</h3>
</div>
<div class="slidelinkspan">
Plus d'infos
</div>
</div>
</div>
<div class="six columns">
<div class="cro_fpc cro_fpsmall">
<div class="cro_backgroundmask"> </div>
<img class="attachment-fc2 wp-post-image" alt="front (1)" src="http://infine-traiteur.ch/wp-content/uploads/2014/09/front-1.png" height="170" width="465">
<div class="fptitles">
<h3 class="fptitle cro_accent">
Rejoignez-nous sur Facebook
</h3>
</div>
<div class="slidelinkspan">
Plus d'infos
</div>
</div>
<div class="cro_fpc cro_fpbig">
<div class="cro_backgroundmask"> </div>
<img class="attachment-fc1 wp-post-image" alt="front (2)" src="http://in-fine.dg-site.com/wp-content/uploads/2014/09/front-2.jpg" height="340" width="465">
<div class="fptitles">
<h3 class="fptitle cro_accent">
Suggestions de la semaine
</h3>
</div>
<div class="slidelinkspan">
Plus d'infos
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
Can you help me to solve this problem please?
Thanks in advance!
Lines from 4627 to 4643 in your site.css file (Media queries for mobile)
Remove or comment this lines.