I am working on formatting for a better user experience using bootstrap3. I have decided to implement the row-fluid(grid) layout. However the issue is that both grids are stick on each other instead of having some space between them. It is like the second grid cannot tell where the float ends. I have tried clear, search online but up to now no luck. I appreciate any help I can get. Here is my code
<div class="row-fluid">
<!--First grid-->
<div class="col-lg-4 col-md-5 col-xs-14" style="border:1px solid black; border-radius:5px;">
<div class="thumbnail pull-left">
<?php echo '<img class="profilePic" class="img-responsive" src="../' . $imageProfile . '" height="160" width="160" style="border-radius:10px;" />';?>
<p class="updateProfilePic">
Update profile picture
<br/>
<img src="../webImage/cameraIcon.png" height="20" width="20"/>
</p>
</div>
<div>
<h3><?php echo $name?></h3>
<h4><?php echo $type?></h4>
</div>
<div style="clear:both" class="row-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">About Me</div>
</div>
<div class="panel-body">
<span><?php echo $about?></span>
</div>
<div class="panel-heading">
<div class="panel-title">Email</div>
</div>
<div class="panel-body">
<span><?php echo $email?></span>
</div>
<div class="panel-heading">
<div class="panel-title">Phone</div>
</div>
<div class="panel-body">
<span><?php echo $phone?></span>
</div>
<div class="panel-heading">
<div class="panel-title">Website</div>
</div>
<div class="panel-body">
<span><?php echo $website?></span>
</div>
<div class="panel-heading">
<div class="panel-title">Experience</div>
</div>
<div class="panel-body">
<span><?php echo $experience?></span>
</div>
<div class="panel-heading">
<div class="panel-title">City</div>
</div>
<div class="panel-body">
<span><?php echo $city?></span>
</div>
</div>
</div>
</div>
<!--Second grid-->
<div class="clearfix col-lg-7 col-md-5 col-xs-14" style="border:1px solid black; border-radius:5px;">
<div class="thumbnail" >
<?php echo '<img src="../' . $imageCover . '" height="180" width="350"/>';?>
</div>
<p class="updateCoverPic">
Update cover picture
<br/>
<img src="../webImage/cameraIcon.png" height="20" width="20"/>
</p>
<div class="panel panel-default">
<div class="panel-heading active" style="color:white">
<div class="panel-title">Nearby Events</div>
</div>
<div class="panel-heading">
<div class="panel-title">
<div class="loadContent"></div>
</div>
</div>
</div>
</div>
</div>
You can set a margin to all grid-cols in a row
.class{ margin:0 20px; }
So the grid-cols are more in mid
I just solved it. I added margin-left to the second grid. However I am up for any other solutions that you guys might have.
A good way to add spacing between the grids is to just add another div inside your columns. This way, you dont have to set any margins on the grid itself. Here's an example:
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="your-custom-div">
<p>Putting this custom div will allow you to have natural
spacing betweem the grid. </p>
</div>
</div>
</div>
</div>
Your columns obviously have to add to 12. I've only used 4/12 above. Feel free to message if you're confused.
Cheers,
Related
Good evening, i have one question, how can i hide this logo enter image description here
in my website with a custom css?
this is my code, i think the class of my logo is sticky-logo, itried so much but i can't hide it. please help me.
<body class="page-template page-template-page-templates page-template-landing-page page-template-page-templateslanding-page-php page page-id-10270 logged-in siteorigin-panels" id="thim-body">
<div id="wrapper-container" class="wrapper-container">
<div class="content-pusher " style="padding-top: 149px;">
<header id="masthead" class="site-header affix-top sticky-header header_default header_v1">
<div id="toolbar" class="toolbar">
<div class="container">
<div class="row">
<div class="col-sm-12">
<aside id="text-2" class="widget widget_text">
<div class="textwidget">
<div class="thim-have-any-question"> Hai delle domande?
<div class="mobile"><i class="fa fa-phone"></i><span class="value">045 581062</span></div>
<div class="email"><i class="fa fa-envelope"></i>segreteria#corsiverona.it</div>
</div>
</div>
</aside>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="navigation col-sm-12">
<div class="tm-table">
<div class="width-logo table-cell sm-logo">
<img src="https://www.corsiverona.it/wp-content/uploads/2016/05/Corsi-verona_logoArancio-Nero2.jpg" alt="CorsiVerona" width="300" height="59">
<a href="https://www.corsiverona.it/" title="CorsiVerona - Un nuovo sito professionale marcato Corsi Verona"
rel="home" class="sticky-logo"> <img src="https://www.corsiverona.it/wp-content/uploads/2016/05/Corsi-verona_logoArancio-Nero2.jpg" alt="CorsiVerona" width="300" height="59">
It looks like you can hide your logo like this:
.sm-logo {
display: none;
}
Try the snippet below:
.sm-logo {
display: none;
}
<body class="page-template page-template-page-templates page-template-landing-page page-template-page-templateslanding-page-php page page-id-10270 logged-in siteorigin-panels" id="thim-body">
<div id="wrapper-container" class="wrapper-container">
<div class="content-pusher " style="padding-top: 149px;">
<header id="masthead" class="site-header affix-top sticky-header header_default header_v1">
<div id="toolbar" class="toolbar">
<div class="container">
<div class="row">
<div class="col-sm-12">
<aside id="text-2" class="widget widget_text">
<div class="textwidget">
<div class="thim-have-any-question"> Hai delle domande?
<div class="mobile"><i class="fa fa-phone"></i><span class="value">045 581062</span></div>
<div class="email"><i class="fa fa-envelope"></i>segreteria#corsiverona.it</div>
</div>
</div>
</aside>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<div class="navigation col-sm-12">
<div class="tm-table">
<div class="width-logo table-cell sm-logo">
<img src="https://www.corsiverona.it/wp-content/uploads/2016/05/Corsi-verona_logoArancio-Nero2.jpg" alt="CorsiVerona" width="300" height="59">
<img src="https://www.corsiverona.it/wp-content/uploads/2016/05/Corsi-verona_logoArancio-Nero2.jpg" alt="CorsiVerona" width="300" height="59">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
I'm working on a template and my code looks something like this. It looks how I want to looks, but I don't know if it's ok technical talking.. Need some tips:
<div class="row">
<div class="col-xs-5 padding-box-product-image margin-image-product">
<div class="pic-box-product">
<img class="img-upload img-responsive" src="srcimg.png" />
</div>
</div>
<div class="col-xs-7 width-content-product">
<div class="col-xs-12 no-padding-left">
<h2 class="col-xs-7 no-margin no-padding line-height-product title-product">Ttesta</h2>
<p class="col-xs-5 no-margin dots-product-page line-height-product ">● ● ●</p>
<p class="col-xs-12 no-margin no-padding line-height-product subtitle-product">Xytzadwa </p>
<p class="col-xs-12 no-margin no-padding line-height-product date-product">My test</p>
<div class="col-xs-12 decoration decoration-margins-product-first"></div>
<img class="col-xs-4 img-responsive" src="/images/icon.png" />
</div>
</div>
</div>
It looks ok, except all of the no-padding will elimnate the normal Bootstrap gutter (space between columns). Also, the nested columns should be wrapped in another row. From the Bootstrap docs
Content should be placed within columns, and only columns may be
immediate children of rows.
The last img shouldn't have col-xs-4. Place it inside a column instead. In general the grid col-* is for block elements like the DIV html tag. It shouldn't be for other elements that have other styles (h2, p, etc..)
<div class="row">
<div class="col-xs-5 padding-box-product-image margin-image-product">
<div class="pic-box-product">
<img class="img-upload img-responsive" src="//placehold.it/900x500">
</div>
</div>
<div class="col-xs-7 width-content-product">
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="col-xs-7"><h2 class="line-height-product title-product">Ttesta</h2></div>
<div class="col-xs-5"><p class="dots-product-page line-height-product ">● ● ●</p></div>
<div class="col-xs-12"><p class="line-height-product subtitle-product">Xytzadwa </p></div>
<div class="col-xs-12"><p class="line-height-product date-product">My test</p></div>
<div class="col-xs-12 decoration decoration-margins-product-first"></div>
<div class="col-xs-4"><img class="img-responsive" src="//placehold.it/70"></div>
</div>
</div>
</div>
</div>
</div>
http://www.codeply.com/go/hOXVBXdb5B
I use class media bootstrap to listing the contact information. It gives me this result :
I want the detail contacts to be in one row (not stacking like that). I did the div class=row but doesn't give me what I want.
this is my code :
<section id="kontak">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2>Kontak</h2>
<hr class="hr-line">
<h5>Konfirmasi Pembayaran atau Informasi Lainnya Silahkan Hubungi Kami Di</h5>
<br>
</div>
</div>
<div class="row">
<div class="media">
<div class="col-sm-4">
<div class="media-left"><img class="media-object" src="<?php echo base_url('asset/img/whatsapp.jpg');?>" alt="..."></div>
<div class="media-body">
<h4 class="media-heading">Whatsapp</h4>
<h5>+62-898-2057-545</h5>
</div>
</div>
</div>
<div class="media">
<div class="col-sm-4">
<div class="media-left"><img class="media-object" src="<?php echo base_url('asset/img/email.jpg') ?>" alt="..."></div>
<div class="media-body">
<h4 class="media-heading">Email</h4>
<h7><strong>kirimundangandotcom#gmail.com</strong></h7>
</div>
</div>
</div>
<div class="media">
<div class="col-sm-4">
<div class="media-left"><img class="media-object" src="<?php echo base_url('asset/img/phone.png') ?>" alt="..."></div>
<div class="media-body">
<h4 class="media-heading">Telepon</h4>
<h5>+62-898-2057-545</h5>
</div>
</div>
</div>
</div>
</div>
</section>
Please help :(
your media blocks are inside out...
<div class="col-sm-4">
<div class="media">
<div class="media-left"><img class="media-object" src="<?php echo base_url('asset/img/email.jpg') ?>" alt="..."></div>
<div class="media-body">
<h4 class="media-heading">Email</h4>
<h7><strong>kirimundangandotcom#gmail.com</strong></h7>
</div>
</div>
</div>
your .col_* blocks should be the only direct children of your .rows. everything in a row should be in a column.
only thing you need is to remove div with class media
<section id="kontak">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2>Kontak</h2>
<hr class="hr-line">
<h5>Konfirmasi Pembayaran atau Informasi Lainnya Silahkan Hubungi Kami Di</h5>
<br>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="media-left"><img class="media-object" src="<?php echo base_url('asset/img/whatsapp.jpg');?>" alt="..."></div>
<div class="media-body">
<h4 class="media-heading">Whatsapp</h4>
<h5>+62-898-2057-545</h5>
</div>
</div>
<div class="col-sm-4">
<div class="media-left"><img class="media-object" src="<?php echo base_url('asset/img/email.jpg') ?>" alt="..."></div>
<div class="media-body">
<h4 class="media-heading">Email</h4>
<h7><strong>kirimundangandotcom#gmail.com</strong></h7>
</div>
</div>
<div class="col-sm-4">
<div class="media-left"><img class="media-object" src="<?php echo base_url('asset/img/phone.png') ?>" alt="..."></div>
<div class="media-body">
<h4 class="media-heading">Telepon</h4>
<h5>+62-898-2057-545</h5>
</div>
</div>
</div>
</div>
</section>
Your structure is not correct
<div class="col-sm-4">
<div class="media">
- - - - - - -
</div>
</div>
. I take your example. check demo
What would be the best / correct method to replicate the following using bootstrap. There are four colum, each of which is 25% wide, and I would like to add an image inbetween. The columns remain 25% all the way from mobile to desktop.
Simple
<div class="row">
<div class="col-xs-3 pull-left">
<div class"col-xs-10">
<img src="envelop.png" class="img-responsive"/>
</div>
<div class"col-xs-2 text-center">
<img src="plus.png" class="img-responsive"/>
</div>
</div>
<div class="col-xs-3 pull-left">
<div class"col-xs-10">
<img src="envelop.png" class="img-responsive"/>
</div>
<div class"col-xs-2 text-center">
<img src="plus.png" class="img-responsive"/>
</div>
</div>
<div class="col-xs-3 pull-left">
<div class"col-xs-10">
<img src="envelop.png" class="img-responsive"/>
</div>
<div class"col-xs-2 text-center">
<img src="plus.png" class="img-responsive"/>
</div>
</div>
<div class="col-xs-3 pull-left">
<div class"col-xs-10">
<img src="envelop.png" class="img-responsive"/>
</div>
<div class"col-xs-2 text-center">
</div>
</div>
</div>
PS: You may use text or content for + sign ... its upto you !! I prefer text/content because it will render faster then image.
This seems to do the job, though it's a bit convoluted. The 15-column layout is tricky.
.row.shift-left {
margin-left: -20px;
}
<div class="container-fluid">
<div class="row">
<div class="col-xs-11 col-xs-offset-1">
<div class="row shift-left">
<div class="col-xs-3">
<div class="row">
<div class="col-xs-9">Words words words.</div>
<div class="col-xs-3">
<img src="http://placehold.it/300x800" class="img-responsive" />
</div>
</div>
</div>
...
Demo
I have a <p> that I need to wrap around a responsive embedded video on my site.
Before I knew my client wanted to have a large amount of <p> content, I simply made two columns.
<div class="container">
<div class="row">
<div class="col-md-6 ">
<div class="embed-responsive embed-responsive-16by9">
<iframe src="//www.youtube.com/embed/<?= $this->page->getPageYouTubeId() ?>" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-6 ">
<h1 class="big-title"><?= $this->page->getPageHeadline() ?></h1>
<div class="blog-title">
<p><?= $this->page->getPageContent() ?></p>
</div>
<a class="btn btn-default scrollto" href="#content"><i class="fa fa-arrow-down"></i> Check Out The Properties!</a>
</div>
</div>
I know a need to use a float: left in someway, but I have tried various things and none of them are working ie...
<div class="row">
<div class="col-md-12 ">
<div class="pull-left">
<div class="embed-responsive embed-responsive-16by9">
<iframe src="//www.youtube.com/embed/<?= $this->page->getPageYouTubeId() ?>" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<h1 class="big-title"><?= $this->page->getPageHeadline() ?></h1>
<div class="blog-title">
<p><?= $this->page->getPageContent() ?></p>
</div>
<a class="btn btn-default scrollto" href="#content"><i class="fa fa-arrow-down"></i> Check Out The Properties!</a>
</div>
</div>
</div>
I am a backend dev so this stuff isn't my strong suit.
http://webwarephpdevelopment.com:8080/fl/West-Palm-Beach