i'm creating a grid of two rows, first one would be the sidebar and the other one (with other two rows in his inside) is the main content:
<div class="container-fluid">
<div class="row">
<div class="col-md-2 col-align-self-center sidebar" style="border-right: 5px solid #b3daff ">
<ul>
<li><button style="border:1px solid #9dbbe4;" class="change-button" id="change-order" onclick="change()" type="button">Start Moving</button></li>
<li><button style="border:1px solid #9dbbe4;" class="change-button" onclick="stop()" type="button">Stop Moving</button></li>
<li><button style="border:1px solid #9dbbe4;" class="change-button" onclick="hide()" type="button">Hide Elements</button></li>
<li><button style="border:1px solid #9dbbe4;" class="change-button" onclick="hide()" type="button">Hide Elements</button></li>
<li><button style="border:1px solid #9dbbe4;" class="change-button" onclick="restore()" type="button">Restore Elements</button></li>
<li><button style="border:1px solid #9dbbe4;" class="change-button" onclick="zoom()" type="button">Zoom In</button></li>
<li><button style="border:1px solid #9dbbe4;" class="change-button" onclick="resize()" type="button">Zoom Out</button></li>
</ul>
</div>
<div class="col-md-10 main-content">
<div class="row"> <!--first row -->
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="box" style="order:1">
<img class="meeseks" src="img/meeseks_purple.jpg" />
<div class="button-box">
<button style="background-color:#BA69B6;border:4px solid #BA69B6" class="button" type="button">Pick Up My Color!</button>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="box" style="order:2">
<img class="meeseks" src="img/meeseks_purple.jpg" />
<div class="button-box">
<button style="background-color:#BA69B6;border:4px solid #BA69B6" class="button" type="button">Pick Up My Color!</button>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="box" style="order:3">
<img class="meeseks" src="img/meeseks_purple.jpg" />
<div class="button-box">
<button style="background-color:#BA69B6;border:4px solid #BA69B6" class="button" type="button">Pick Up My Color!</button>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="box" style="order:4">
<img class="meeseks" src="img/meeseks_purple.jpg" />
<div class="button-box">
<button style="background-color:#BA69B6;border:4px solid #BA69B6" class="button" type="button">Pick Up My Color!</button>
</div>
</div>
</div>
</div>
<div class="row"> <!--second row -->
<div class="col-md-3">col</div>
<div class="col-md-3">col</div>
<div class="col-md-3">col</div>
<div class="col-md-3">col</div>
</div>
</div>
</div>
</div>
working well on xs device and sm device. But in some resolution for md device (like 1024x768 ) the images dont have the correct spacing and overflow their wrapper. How can i solve?
Thanks in advance
ok, i had forgotten the overflow property, now when i resize the page the images dont overflow they div box. The effect is not so nice, but is much better.
Related
I have 7 columns(monday-sunday) using bootstrap.
Here is code in View
<div id="left3" style="padding-right: 140px;" >
<div class="row">
<div class="col-md-2">Mon</div>
<div class="col-md-2">Tue</div>
<div class="col-md-2">Wen</div>
<div class="col-md-2">Thu</div>
<div class="col-md-2">Fri</div>
<div class="col-md-1">Sat</div>
<div class="col-md-1">Sun</div>
</div>
<div class="row">
<div class="col-md-2">1</div>
<div class="col-md-2">2</div>
<div class="col-md-2">3</div>
<div class="col-md-2">4</div>
<div class="col-md-2">5</div>
<div class="col-md-1">6</div>
<div class="col-md-1">7</div>
</div>
</div>
And when I try to add border like this
style="border-style: solid; border-color: #1d69b4;border-radius: 10px;"
I got this
How I can center text in column and make it like on this design?
I have one row and two columns in it. Right column's content overlaps to left column. Here is my codes.
Even in the large screen I see that (in below code) <div class="row hidden-xs" style="border-bottom: 2px solid lightgray;">
this border overlaps to left.
Here is how it looks
How do I prevent overlapping their contents?
<div class="row">
<div class="col-lg-2" style="letter-spacing: 1px;">
<img src="~/Content/images/kitap/kitap2.jpg" style="width:250px; height:350px;"/>
<h5><b>ISBN:</b>1234567891</h5>
<h5><b>Kapak Türü:</b> Sert Kapak</h5>
<h5><b>Baskı No:</b>16</h5>
<h5><b>Yayınevi:</b>Publishing </h5>
<h5><b>Yıl:</b> 2005</h5>
</div>
<div class="col-lg-10">
<ul class="nav nav-tabs">
<li class="active">Yeni ve 2. El</li>
<li>Kirala</li>
<li>Kitap Detaylı Bilgileri</li>
<li>Kitap Yorumları</li>
</ul>#*nav nav-tabs*#
<div class="tab-content">
<div class="tab-pane active" id="satinAl">
<div class="row hidden-xs" style="border-bottom: 2px solid lightgray;">
<div class="col-md-3">
<h5><b>Fiyat + Kargo</b></h5>
</div>
<div class="col-md-3">
<h5><b>Kitabın Durumu</b></h5>
</div>
<div class="col-md-3">
<h5><b>Tahmini Teslim Tarihi</b></h5>
</div>
<div class="col-md-3">
<h5><b>Satıcı Bilgileri</b></h5>
</div>
</div> #*Başlık 1. row*#
<div class="row">
<div class="col-md-3">
<h5><b>39.87 TL</b></h5>
<h6>3.99 TL Kargo</h6>
</div>
<div class="col-md-3">
<h5><b>Çok İyi</b></h5>
<h6>Kitap çok iyi durumdadır. Çizgi karalam yoktur. Çok iyi müşteri hizmetleri. Alan Memnun</h6>
</div>
<div class="col-md-3">
<h5><b>Feb. 24 - Mar. 3.</b></h5>
<h6>Satıcı İade Politikası</h6>
</div>
<div class="col-md-3">
<h5><b>Jenny Blue</b></h5>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
100% Pozitif
</div>
</div> #*Ilk Satıcı 2. row*#
</div>#*tab-pane active Satın Al*#
<div class="tab-pane" id="kirala">
<p>Çok yakında hizmetinizde</p>
</div>
</div>#*tab-content*#
</div>#*col-md-10*#
</div>#*row*#
To make columns to behave responsively you need to remove fixed dimensions of image:
<img src="~/Content/images/kitap/kitap2.jpg" style="width:250px; height:350px;"/>
and set class="img-responsive" to it:
<img src="~/Content/images/kitap/kitap2.jpg" class="img-responsive"/>
here is a working example
It is because the image is bigger than the column.
You need either to use bootstrap img-responsive class and remove the width and height attributes in img
or
make the cols bigger , ex: use col-lg-4 for the first column and col-lg-8 for the second column.
I have a problem. Now I have bunch of divs in my code and i am using bootstrap, what I want is to make my content with control buttons be inline in small devices (like phone).However, i get something like this:
but that button should be in same line. Here is my code:
<div class='container-fluid info text-center'>
<h1>Truputėlis apie mane</h1>
<div class='row'>
<div class='col-xs-1 col-sm-1 col-md-4'>
<a href='#'><div class='controls left'><span class='glyphicon glyphicon-triangle-left' class='controls'></span>
</div></a>
</div>
<div class='col-xs-10 col-sm-10 col-md-4 about_me'>
<div style='background: url(notebook8.png);font-family: Dynalight; font-size:28px;padding-top:15px;padding-left:50px;padding-bottom:5px;margin:0 auto;border:1px solid grey;'>
<img src='http://www.arlongpark.net/customavatars/avatar23489_6.gif' style='width:80px; height:80px; background-color:white; border:1px solid black; border-radius:150px;'><br/>
<div class='about_me_text text-left'>
</div>
</div>
</div>
<div class='col-xs-1 col-sm-1 col-md-4'></div>
<a href='#' >
<div class='controls right'>
<span class='glyphicon glyphicon-triangle-right'></span>
</div>
</a>
</div>
</div>
</div>
What should I do? Sorry for my terrible english, hope you understood something...
I've style border: 1px solid black; to determine if it is correct box, but it overlap and goes outside. This is my html
<div class="panel panel-default">
<div class="panel-body">This page is temporarily disabled by the site administrator for some reason.</div>
<div class="panel-footer clearfix">
<p>Drink whaterver jklasd jklasd jklnxm,c kasdk jj jjjjs lasd jklasd m,zxc asd kljaskd kljasd kl</p>
<div style="border: 1px solid black; display: block;" class="pull-left">
<div class="row">
<p>By Jerald Patalinghug</p>
</div>
<div class="row">
Tags: Funny, Wtf, Nice
</div>
</div>
<div style="border: 1px solid black;" class="pull-right">
<div id="votes">
<div class="row">
<a href="#" data-card_id="26" class="vote upvote btn btn-default">
<span class="fa fa-thumbs-up"></span>
</a>
<a href="#" data-card_id="26" class="vote downvote btn btn-default">
<span class="fa fa-thumbs-down"></span>
</a>
</div>
<div class="row">
<center>
<span class="vote_count">1</span> points
</center>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
and this is the image
look, the inside of div.pull-left are going outside.
EDIT1
Thanks guys, What I did was remove class="row" on every div
<div class="panel panel-default">
<div class="panel-body">This page is temporarily disabled by the site administrator for some reason.</div>
<div class="panel-footer clearfix">
<p>Drink whaterver jklasd jklasd jklnxm,c kasdk jj jjjjs lasd jklasd m,zxc asd kljaskd kljasd kl</p>
<div style="border: 1px solid black; display: block;" class="pull-left">
<div>
<p>By Jerald Patalinghug</p>
</div>
<div>
Tags: Funny, Wtf, Nice
</div>
</div>
<div style="border: 1px solid black;" class="pull-right">
<div id="votes">
<div>
<a href="#" data-card_id="26" class="vote upvote btn btn-default">
<span class="fa fa-thumbs-up"></span>
</a>
<a href="#" data-card_id="26" class="vote downvote btn btn-default">
<span class="fa fa-thumbs-down"></span>
</a>
</div>
<div>
<center>
<span class="vote_count">1</span> points
</center>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
Remove the
<div class="row">
inside each of the bordered div's - these are adding -15px to the left and right. These are only to be used when you are nesting inside .container or .col-sm-12 (for example).
This is a good read if you're not 100% sure on how the bootstrap grid works:
http://www.helloerik.com/the-subtle-magic-behind-why-the-bootstrap-3-grid-works
Use class container-fluid along with pull-left/pull-right.
Solution:
<div class="panel panel-default">
<div class="panel-body">This page is temporarily disabled by the site administrator for some reason.</div>
<div class="panel-footer clearfix">
<p>Drink whaterver jklasd jklasd jklnxm,c kasdk jj jjjjs lasd jklasd m,zxc asd kljaskd kljasd kl</p>
<div style="border: 1px solid black; display: block;" class="pull-left container-fluid">
<div class="row">
<p>By Jerald Patalinghug</p>
</div>
<div class="row">
Tags: Funny, Wtf, Nice
</div>
</div>
<div style="border: 1px solid black;" class="pull-right container-fluid">
<div id="votes">
<div class="row">
<a href="#" data-card_id="26" class="vote upvote btn btn-default">
<span class="fa fa-thumbs-up"></span>
</a>
<a href="#" data-card_id="26" class="vote downvote btn btn-default">
<span class="fa fa-thumbs-down"></span>
</a>
</div>
<div class="row">
<center>
<span class="vote_count">1</span> points
</center>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
Apply padding in style to have nice look
<div style="border: 1px solid black;padding: 2%; display: block;" class="pull-left container-fluid">
<div style="border: 1px solid black;padding: 2%" class="pull-right container-fluid">
I have a layout with Bootstrap. MY problem is that I cannot get the same output on every monitor. In a portable pc the output is different than on a regular monitor.
I have already changed from container to container-fluid but still cannot get the same output on every monitor. Is it possible to read the screen resolution and adjust the code to it?
This is my code:
<body style="overflow: hidden; height: 100%;">
<?php
include ($_SERVER['DOCUMENT_ROOT']."/include/Menu.php");
?>
<div class="jumbotron" style="border-bottom: solid 3px rgb(132, 177, 161);">
<div class="container-fluid">
<div class="row">
<div class="col-md-1" style="padding-left:0px">
<button id="New" type="button" class="btn btn-default btn-sm ButtonEWG">
<img id="ButtonIcon" src="/img/icons/plus.png" style="padding-right: 10px;">
New
</button>
</div>
<div class="col-md-1">
<button id="New" type="button" class="btn btn-default btn-sm ButtonEWG">
<img id="ButtonIcon" src="/img/icons/excel.png" style="padding-right: 10px;">
Export
</button>
</div>
</div>
</div>
</div>
<div class="container-fluid viewport" style="padding: 0px;">
<div class="row thick" style="border-bottom: solid 3px rgb(132, 177, 161); margin: 0px; padding: 0px;">
<div class="col-md-6" style="height: 100%; padding: 0px; border-right: solid 3px rgb(132, 177, 161); border-left: solid 3px rgb(132, 177, 161)">
<div id="OccurrencesGrid" style="border: none"></div>
</div>
<div class="col-md-6">
<div id='DetailsTabs'style="margin-top:10px; border:none">
<ul>
<li style="margin-left: 30px;">Occurrence Details</li>
<li>Occurrence status overview</li>
</ul>
<div style="padding-top:20px; background-color:#F5F5F5;">
<div id='OccurrenceDetails'></div>
</div>
<div style="padding-top:20px; background-color:#F5F5F5">
<div class = "row">
<div class = "col-md-4"><div class="alert alert-info" role="alert" style="background-color: #F5F5F5;">Opening</div></div>
<div class = "col-md-2" align="center"><div class="alert alert-info" role="alert">N/A</div></div>
<div class = "col-md-2" align="center"><div class="alert alert-success" role="alert"><?php echo $StatusGrid[0];?></div></div>
<div class = "col-md-2" align="center"><div class="alert alert-warning" role="alert">N/A</div></div>
<div class = "col-md-2" align="center"><div class="alert alert-danger" role="alert"><?php echo $StatusGrid[1];?></div></div>
</div>
</div>
</div>
</div>
</div>
<div class="row-fluid thin" style="padding-top: 10px;">
<div class="col-md-2">
<div id="LeftDonut" style="height:250px;"></div>
</div>
</div>
</div> <!-- /container -->
I just gave another guy some Mark Up / CSS to keep his site fluid I think this will also help you.padding causes overlap, fluid design?If you need further assistance let me know :D