Bootstrap rawspan and column span - html

Can anybody help me with this problem, I am using bootstrap to develop my website and so far I have two row`s.
<section role="main">
<div class="container">
<div class="row no-space"><!-- Row 1 -->
<div class="span3">
<h2>{ logo here }</h2>
<h3>[ logo here ]</h3>
</div>
<div class="span6">
<h2>Text here, text here <em>text here</em>...</h2>
<h2>text here!</h2>
</div>
<div class="span3">
<img src="img/coffee.png" alt="Coffee and code">
</div>
</div><!-- /Row 1 -->
<div class="row no-space"><!-- Row 2 -->
<div class="span3">
<img src="img/code01.png" alt="Coda2 code">
</div>
<div class="span3">
<img src="img/code01.png" alt="Coda2 code">
</div>
</div><!-- /Row 2-->
</div><!-- Container -->
</section><!-- MAIN -->
The entire website will be built using span3 and 6, with a height of 220 for span3 and 460 for span6. Because span6 has a double height as against span 3, it will be a gap of 240px between the span3 from the first row and the first span3 from the secound row.
How I can remove this gap, I tried nesting but is not really something that I need, because the divs(span3) will be shuffled every time the website will be reloaded.
Thank you for your time and help.

I think what u want to do is think of the spans as columns and add the data inside of the columns
<section role="main">
<div class="container">
<div class="row no-space"><!-- Row 1 -->
<div class="span3">
<h2>{ logo here }</h2>
<h3>[ logo here ]</h3>
<img src="img/code01.png" alt="Coda2 code">
</div>
<div class="span6" data-rowspan="2" data-colspan="2">
<h2>Text here, text here <em>text here</em>...</h2>
<h2>text here!</h2>
</div>
<div class="span3">
<img src="img/coffee.png" alt="Coffee and code">
<img src="img/code01.png" alt="Coda2 code">
</div>
</div><!-- /Row 1 -->
</div><!-- Container -->

Related

divs are not horizantal bootstrap

I want to make 3 columns horizontal and ı use col-md-12 for main column and for child columns col-md-4 but my row have only one columns and sub divs are vertical.My english not good enough but please help me.All divs are under other div and all divs are left side of page.I try my html in other project this is worked but in this projecy one thing corrupted my grid system but ı cant find it.
This is my nested Layout
#model HomeViewModel
#*#{
ViewData["Title"] = "News";
}*#
#section PageTitle{
etwyrjs
}
#section PageDesc{
etwyrjs
}
#*<div class="col-md-12">
<h2>News</h2>
</div>*#
#foreach (var pie in Model.Pies)
{
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="#pie.ImageThumbnailUrl" alt="" />
<div class="caption">
<h3 class="pull-right">#pie.Price.ToString("c")</h3>
<h3>
<a asp-controller="Home" asp-action="Details"
asp-route-id="#pie.Id">#pie.Name</a>
</h3>
<p>#pie.ShortDescription</p>
</div>
</div>
</div>
}
This is my nested Layout.
#{
ViewData["Title"] = "LayoutForOthers";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="row">
<div class="col-md-12">
<img src="~/images/büyük foto-1.png" alt="Snow" style="width:100%;">
#*<div class="bottom-left">
</div>*#
<div class="top-left">
<h1 style="text-align:left; color:white">#RenderSection("PageTitle")</h1>
<br />
<br />
<p style="text-align:left; color:white;">#RenderSection("PageDesc") Dijital sağlık alanında dünyanın önde gelen isimlerinden olan ve İngiltere'nin en büyük sağlık teknolojisi topluluğu Health 2.0 London'ı kuran Maneesh Juneja, yapay zekanın geleceği hakkında önemli açıklamalarda bulundu. Kendisini ''dijital sağlık fütüristi'' olarak nitelendiren Juneja, geçtiğimiz hafta İstanbul'da katıldığı etkinlikte yapay zeka ile ilgili soruları yanıtlarken 2040 yılının önemli bir dönüm noktası olabileceğini işaret etti.</p>
</div>
#*<div class="top-right">Top Right</div>
<div class="bottom-right">Bottom Right</div>
<div class="centered">Centered</div>*#
</div>
</div>
<div class="row">
<div class="col-md-12">
#RenderBody()
</div>
</div>
This is from my main layout.
<div class="col-md-12">
#RenderBody()
</div>
Are you looking for something like this? This should work regardless of what your Bootstrap version is. (Open it in fullscreen)
<!-- Include this in your <head> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="row">
<div class="col-sm-12 bg-primary">
<!-- This is you full width column -->
<p>This is you full width column</p>
</div>
<div class="row">
<div class="col-sm-4 bg-danger">
<!-- This is 1/3 columns -->
<p>Column 1</p>
</div>
<div class="col-sm-4 bg-info">
<!-- This is 2/3 columns -->
<p>Column 2</p>
</div>
<div class="col-sm-4 bg-success">
<!-- This is 3/3 columns -->
<p>Column 3</p>
</div>
</div>
</div>

bootstrap columns overlapping

I have an issue with bootstrap's grid layout. My columns are overlapping one another when I resize the screen to a smaller layout.
I'm not sure what the issue is.
Here is a picture of what is going on:
Here is my code
<div class='container-fluid'>
<div class="row"> <!-- 1 -->
<div class="col-sm-5 col-md-4">
<h1>JOHN SMITH</h1>
</div>
</div>
<div class='row'> <!-- 2 -->
<div class="col-sm-5 col-md-4">
<h2>VULCAN FLATBED</h2>
</div>
</div>
<div class="row"> <!-- 3 -->
<div class="col-sm-4 col-md-4 col-lg-4" style="background-color:yellow;">
<div class='row'>
<img src="vulcan.jpg" alt="vehicle image" width='391'/>
</div>
<div class='row'>
<button type='submit'>
<img src="book_now_button#2x.png" alt="book now">
</button>
</div>
</div>
<div class="col-sm-8 col-md-8 col-lg-8" style="background-color:pink;"> <!-- RIGHT SIDE -->
<div class='row'>
<h3>CAN HELP WITH</h3>
<p>LIFTING & YARD WORK</p>
</div>
<div class='row'>
<h3>AVAILABLE</h3>
<p>ALL WEEKENDS</p>
</div>
<div class='row'>
<h3>NOTE</h3>
<p>HI, MY NAME IS JOHN AND I HAVE A GREAT TRUCK FOR TRANSPORTING CARS,
WORK MATTERIAL, OR HEAVY OBJECTS. I HAVE A FULL TIME JOB SO I CAN
ONLY HELP YOU ON THE WEEKENDS. I LOVE WORKING WITH MY HANDS SO IF YOU
SOME HELP WITH LIFTING OR YARDWORK I AM YOUR GUY. BOOK NOW TO CONTACT
ME AND LET ME HELP YOU OUT.
</p>
</div>
</div>
</div> <!-- end 3 -->
<hr>
</div> <!-- end wrap -->
According to Bootstrap Docs, for each .row you need to have a .col-*-* as direct child but you don't have it in a few of them. Which cause the overflow.
Plus don't use the html tag width, it is deprecated. use class="img-responsive" from bootstrap to achieve max-width:100%
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class='container-fluid'>
<div class="row">
<!-- 1 -->
<div class="col-sm-5 col-md-4">
<h1>JOHN SMITH</h1>
</div>
</div>
<div class='row'>
<!-- 2 -->
<div class="col-sm-5 col-md-4">
<h2>VULCAN FLATBED</h2>
</div>
</div>
<div class="row">
<!-- 3 -->
<div class="col-sm-4 col-md-4 col-lg-4" style="background-color:yellow;">
<div class='row'>
<div class="col-xs-12">
<img class="img-responsive" src="//lorempixel.com/500/200" alt="vehicle image" />
</div>
</div>
<div class='row'>
<div class="col-xs-12">
<button type='submit'>
<img src="book_now_button#2x.png" alt="book now">
</button>
</div>
</div>
</div>
<div class="col-sm-8 col-md-8 col-lg-8" style="background-color:pink;">
<!-- RIGHT SIDE -->
<div class='row'>
<div class="col-xs-12">
<h3>CAN HELP WITH</h3>
<p>LIFTING & YARD WORK</p>
</div>
</div>
<div class='row'>
<div class="col-xs-12">
<h3>AVAILABLE</h3>
<p>ALL WEEKENDS</p>
</div>
</div>
<div class='row'>
<div class="col-xs-12">
<h3>NOTE</h3>
<p>HI, MY NAME IS JOHN AND I HAVE A GREAT TRUCK FOR TRANSPORTING CARS, WORK MATTERIAL, OR HEAVY OBJECTS. I HAVE A FULL TIME JOB SO I CAN ONLY HELP YOU ON THE WEEKENDS. I LOVE WORKING WITH MY HANDS SO IF YOU SOME HELP WITH LIFTING OR YARDWORK I
AM YOUR GUY. BOOK NOW TO CONTACT ME AND LET ME HELP YOU OUT.
</p>
</div>
</div>
</div>
I believe your problem is that you have many elements with the "row" class that don't have any columns in them. The hierarchy goes container > row > col. Without a column, there is no need for anything to be declared a row, and it affects the layout in unusual ways without them.
Another problem is your image. Remove the "width" attribute, and add the following class attribute: class="img-responsive". See the Images section of the bootstrap docs for details.
In my case, I was using box-sizing: content-box; for all my elements in css. That is why padding was creating problems with overall computed width of the elements. So, I changed it to box-sizing: border-box; from box-sizing: content-box;
Ref:
https://getbootstrap.com/docs/4.0/getting-started/introduction/#box-sizing

Paragraph text using img space

I'm trying to make the whole thing clickable so I wrapped the image and paragraph inside an anchor tag. I gave the anchor tag a padding of 40px around and gave the img tag a right margin of around 30. Both of them have a display property of inline-block. The problem is it doesn't show like the one on the image(attached). How do I fix this? I'm not that good at CSS and HTML yet. Thanks.
<div class="col-md-3">
<img src="_assets_/images/icon-meeting.png" alt="meeting minutes and agendas"><p>Meeting Minutes & Agendas</p>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<img src="_assets_/images/icon-bills.png" alt="pay bills online"><p>Pay Bills Online</p>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<img src="_assets_/images/icon-document.png" alt="form & document center"><p>Form & Document Center</p>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<img src="_assets_/images/icon-questions.png" alt="frequently asked questions"><p>Frequently Asked Questions</p>
</div><!-- /.col-md-3 -->
My CSS is:
#panel p {font-family: 'Raleway', sans-serif;color: #fff;font-size: 18px;display: inline-block;margin: 0}
#panel img {width: 45px;margin-right: 25px;display: inline-block}
#panel a {background-color: #1b4952;display: block;border-radius: 10px;text-decoration: none}
What I want
What I have
I guest you use bootstrap :)
About that you can make it using row. I just simple edit your code check and try it i hope it's help you.
<div class="col-md-3">
<div class="row">
<div class="col-md-6">
<a href="./"><img src="_assets_/images/icon-meeting.png" alt="meeting minutes and agendas">
<div class="col-md-6">
<p>Meeting Minutes & Agendas</p></a>
</div>
</div>
</div>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<div class="row">
<div class="col-md-6">
<a href="./">
<img src="_assets_/images/icon-bills.png" alt="pay bills online">
<div class="col-md-6">
<p>Pay Bills Online</p></a>
</div>
</div>
</div>
</div>
<!-- /.col-md-3 -->
<div class="col-md-3">
<div class="row">
<div class="col-md-6">
<a href="./">
<img src="_assets_/images/icon-document.png" alt="form & document center">
<div class="col-md-6">
<p>Form & Document Center</p></a>
</div>
</div>
</div>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<div class="row">
<div class="col-md-6">
<a href="./"><img src="_assets_/images/icon-questions.png" alt="frequently asked questions">
<div class="col-md-6"><p>Frequently Asked Questions</p></a>
</div>
</div>
</div>
</div><!-- /.col-md-3 -->
More informations check this page

Bootstrap - Keep Div and Image on same row at same height

How can I the div on the left and the image on the right at the same height using Bootstrap? They can stack when the screen width gets smaller, but at larger sizes they need to be equal.
<!-- main -->
<div id="main" class="row">
<div class="left col-md-6">
<h1>SCAQMD's Air Alerts lets you stay informed about air quality in your area.</h1>
<div id="round">
<img src="img/arrow.png" alt="arrow">
Sign Up
</div>
<div id="signup">
<h2>SIGN UP TODAY</h2>
<div><!-- line -->
</div>
<h3>to receive Air Alerts<br>Customized for you!</h3>
</div>
</div>
<div class="right col-md-6">
<img src="img/hero.jpg" class="pull-right img-responsive">
</div>
</div>
<!-- main -->

How to disable automatic horizontal to vertical conversion in Bootstrep 3

I am using this code in a page in bootstrap 3.
<div class="description_text">
<div class="row">
<!-- Sunny -->
<div class="col-md-2">
<div class="horizontal_center">
<img src="img/sunnylogo.png" alt="Sunny logo">
</div>
<div class="horizontal_center">
Sunny
</div>
</div>
<!-- End Sunny -->
<!-- Walking -->
<div class="col-md-2">
<div class="horizontal_center">
<img src="img/walkinglogo.png" alt="Walking logo">
</div>
<div class="horizontal_center">
Walking
</div>
</div>
<!-- End Walking -->
<!-- Windy -->
<div class="col-md-2">
<div class="horizontal_center">
<img src="img/windylogo.png" alt="Windy logo">
</div>
<div class="horizontal_center">
Windy
</div>
</div>
<!-- End Windy -->
<!-- Rain -->
<div class="col-md-2">
<div class="horizontal_center">
<img src="img/rainlogo.png" alt="Rain logo">
</div>
<div class="horizontal_center">
Rain
</div>
</div>
<!-- End Rain -->
<!-- Snow -->
<div class="col-md-2">
<div class="horizontal_center">
<img src="img/snowlogo.png" alt="Snow logo">
</div>
<div class="horizontal_center">
Snow
</div>
</div>
<!-- Snow -->
</div>
</div>
When window is full screen, it is OK.
But if I make it small, it making problem.
It goes to vertically.
I want to stop this property of bootstrap in this page.
Can anyone please help me?
Thanks in advance for helping.
You can use more then one class according to resolution
col-md-2 Medium devices Desktops (≥992px)
col-sm-2 Small devices Tablets (≥768px)
col-xs-2 Extra small devices Phones (<768px)
Use
<div class="col-md-2 col-sm-2 col-xs-2"></div>
Simply don't use bootstrap's col-md-x and row classes. Make your own divs and style them by yourself.
Or you could style the col-md-2 class like so:
.col-md-2{
float: left;
}