I am trying twitter's framework to develop my own site and I want my image to resize as the browser size is decreased. I am confused and tried everything but couldn't come up with a solution here is my structure
HTML
<section id="intro">
<div class="row" id="ruby">
<div class="span6" id="heading">
<h1>Journey Into Ruby and Beyond</h1>
<p>A blog about my journey into ruby, my experiences and lots of fun!</p>
</div>
<div class="span6" id="pic" align="right">
<p>Akash Soti<br>RoR Developer<br>@xyz company </p>
</div>
</section><!--/intro-->
CSS
#ruby.row{
margin-left: 0px;
padding-right: 0px;
padding-bottom: 0px;
}
#pic{
background: url(img/Akash.png);
background-repeat: no-repeat;
height: 150px;
width: 200px;
margin-left: 200px;
}
#pic img{
max-width:100% ;
max-height:100% ;
display:block;
}
#pic p{
position: relative;
right: 110px;
margin-top: 90px;
margin-left: 0px;
text-align: left;
}
Twitter bootstrap is designed to make images (and layout) responsive, that is images in your content:
<img src="path/to/images.jpg" alt="some">
Not the images you used as background-images in CSS.
You have to use
@media (max-width: 699px) {
#pic{
background: url(img/Akash.png);
background-repeat: no-repeat;
height: 100px;
width: 150px;
margin-left: 200px;
}
}
But if you want responsive design, try to avoid pixels, use %. And if your background meant to be picture(e.g. photo, pic) but not background-kind of image, use <img>
instead
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With