Don't show background image in entire row - html

I'm trying to show an image full width in the background of three columns. I thought if I wrapped the three columns in a div and put a background on the div, it would happen, instead it showing the background on the entire screen. How do I make it so it just shows in the background below the hr line.
So I don't want the background to show in the sections:
What is an Apple?
The apple tree (Malus domestica) is a deciduous tree in the rose family best known for its sweet, pomaceous fruit, the apple.
Here's my bootply:
http://www.bootply.com/BT0SWRh3aq
Here's my html:
<div class="content-section-a">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h2>What is an Apple?</h2>
<p>The apple tree (Malus domestica) is a deciduous tree in the rose family best known for its sweet, pomaceous fruit, the apple.</p>
<hr class="section-heading-spacer">
<div class="clearfix"></div>
</div>
<div class="row" id="bg-pink-data-points">
<div class="col-md-4 col-xs-12">
<h3>LADY</h3>
<p>One of the oldest known varieties, this tiny apple is said to have gotten its name because women would keep them in their purses to sniff when they encountered bad odors.</p>
</div>
<div class="col-md-4 col-xs-12">
<h3>GRANNY SMITH</h3>
<p>The Baldwin was among the most popular American apples until 1934, when a freeze wiped out most of its trees.</p>
</div>
<div class="col-md-4 col-xs-12">
<h3>GOLDEN DELICIOUS</h3>
<p>This heirloom hails from Denmark, but in the United States, it's grown almost exclusively in Sonoma County, CA, where it's celebrated with an annual festival. </p>
</div>
</div>
</div>
<!-- /.container -->
</div></div>
Here's a CSS:
#bg-pink-data-points {
background-image: url("http://10steps.sg/wp-content/uploads//2012/11/White-christmas-light-background.jpg");
}
.content-section-a {
padding: 50px 0;
}

It looks like you have minor disturbance in your HTML Structure .row in another .row, well you can try this:
<div class="content-section-a">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h2>What is an Apple?</h2>
<p>The apple tree (Malus domestica) is a deciduous tree in the rose family best known for its sweet, pomaceous fruit, the apple.</p>
<hr class="section-heading-spacer">
<div class="clearfix"></div>
</div>
</div>
<div class="row" id="bg-pink-data-points">
<div class="col-md-4 col-xs-12">
<h3>LADY</h3>
<p>One of the oldest known varieties, this tiny apple is said to have gotten its name because women would keep them in their purses to sniff when they encountered bad odors.</p>
</div>
<div class="col-md-4 col-xs-12">
<h3>GRANNY SMITH</h3>
<p>The Baldwin was among the most popular American apples until 1934, when a freeze wiped out most of its trees.</p>
</div>
<div class="col-md-4 col-xs-12">
<h3>GOLDEN DELICIOUS</h3>
<p>This heirloom hails from Denmark, but in the United States, it's grown almost exclusively in Sonoma County, CA, where it's celebrated with an annual festival. </p>
</div>
</div>
</div>
<!-- /.container -->
</div>
Demo URL: http://www.bootply.com/0m5JJ6pMM0
If you wants to play with Background to be extend, you can also play with the same CSS property which is styled for Background #bg-pink-data-points:
#bg-pink-data-points {
background-image: url("http://10steps.sg/wp-content/uploads//2012/11/White-christmas-light-background.jpg");
padding: 10px;
}
You can play with some more options as well. Demo URL:
http://www.bootply.com/Poi6HlXOa8

Please wrap .col-lg-12 in a row to set its proper layout..
<div class="content-section-a">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h2>What is an Apple?</h2>
<p>The apple tree (Malus domestica) is a deciduous tree in the rose family best known for its sweet, pomaceous fruit, the apple.</p>
<hr class="section-heading-spacer">
</div>
</div>
<div class="row" id="bg-pink-data-points">
<div class="col-md-4 col-xs-12">
<h3>LADY</h3>
<p>One of the oldest known varieties, this tiny apple is said to have gotten its name because women would keep them in their purses to sniff when they encountered bad odors.</p>
</div>
<div class="col-md-4 col-xs-12">
<h3>GRANNY SMITH</h3>
<p>The Baldwin was among the most popular American apples until 1934, when a freeze wiped out most of its trees.</p>
</div>
<div class="col-md-4 col-xs-12">
<h3>GOLDEN DELICIOUS</h3>
<p>This heirloom hails from Denmark, but in the United States, it's grown almost exclusively in Sonoma County, CA, where it's celebrated with an annual festival. </p>
</div>
</div>
<!-- /.container -->

Remove the float: left; on the <div class="col-lg-12"> or overwrite it with float: none;

Related

How to center multiple divs within a section?

I know there is an existing question none of the solutions seem to work for me and it's a question posted in 2014.
Here's the code I have:
<section id="team-block">
<div class="team-block-centered">
<div class="col-lg-3 col-sm-6 member-1">
<div class="team-member">
<img
src="http://lvsmiledesigners.com/new/wp-content/uploads/2019/06/dr-tongsiri.jpg"
data-original="http://lvsmiledesigners.com/new/wp-content/uploads/2019/06/dr-tongsiri.jpg"
alt=""
class="lazy"
style="display: block;"
/>
<div class="inner">
<h4 class="name">Dr. Amy Tongsiri</h4>
<p class="position">
<small>Clinical Director</small>
</p>
</div>
<div class="hover">
<div class="description">
<p>
Dr. Amy Tongsiri has joined Smile Designers of Las Vegas in 2017.
She has a joyous energy vibrating the room as she enters. Almost
permanently smiling, she exudes positivity and can easily relaxed
and soothe a nervous patient. The desire to pursue a career in
dentistry came young for Dr. Tongsiri, during the course of her
own dental health. "I originally wanted to do orthodontics, when I
had braces,” she says, flashing the resulting perfect smile. “But
eventually, I found General Dentistry to be more exciting because
you are challenged by being able to cover everything."
</p>
</div>
<div class="read-more">
<a href="/new/dr-amy-tongsiri/" class="button white outline"
>Read more <span class="nc-icon-glyph arrows-1_bold-right"></span
></a>
</div>
</div>
<!--.hover-->
</div>
<!--.team-member-->
</div>
<!--.col-lg-3-->
</div>
<div class="col-lg-3 col-sm-6 member-2">
<div class="team-member">
<img
src="http://lvsmiledesigners.com/new/wp-content/uploads/2019/07/Dr-Dominique-Dela-Cruz.jpg"
data-original="http://lvsmiledesigners.com/new/wp-content/uploads/2019/07/Dr-Dominique-Dela-Cruz.jpg"
alt=""
class="lazy"
style="display: block;"
/>
<div class="inner">
<h4 class="name">Dr. Dominique Dela Cruz</h4>
<p class="position">
<small>Lead Dentist</small>
</p>
</div>
<div class="hover">
<div class="description">
<p>
Providing comprehensive dental care that is tailored to each and
every patient’s needs is Dr. Dominique Dela Cruz’s goal when it
comes to treating patients. She strives to provide dental care in a
comfortable environment while using the most innovative and advanced
technology. Dr. Dela Cruz grew up in Las Vegas, NV. On her spare
time, she likes to stay outdoors as much as possible. She loves to
hike, travel, kayak and snowboard. She also likes to read books and
watch movies with her dogs. Like most of her patients, Dr. Dela Cruz
has a sweet tooth and enjoys eating candy, chocolate and other
pastries.
</p>
</div>
<div class="read-more">
<a href="/new/dr-jorge-jimenez-marquez/" class="button white outline"
>Read more <span class="nc-icon-glyph arrows-1_bold-right"></span
></a>
</div>
</div>
<!--.hover-->
</div>
<!--.team-member-->
</div>
<!--.col-lg-3-->
<div class="col-lg-3 col-sm-6 member-3">
<div class="team-member">
<img
src="http://lvsmiledesigners.com/new/wp-content/uploads/2019/06/karla.jpg"
data-original="http://lvsmiledesigners.com/new/wp-content/uploads/2019/06/karla.jpg"
alt=""
class="lazy"
style="display: block;"
/>
<div class="inner">
<h4 class="name">Karla Brown</h4>
<p class="position">
<small>Office Manager</small>
</p>
</div>
<div class="hover">
<div class="description">
<p>
Delivering outstanding customer service has always been an essential
part of a day’s work for Karla. As Smile Designers of Las Vegas
Office Manager, she is responsible for all office procedures, and
uses her organizational skills to ensure smooth operations in a busy
work environment.
</p>
</div>
<div class="read-more">
<a href="/new/nancy-gutierrez/" class="button white outline"
>Read more <span class="nc-icon-glyph arrows-1_bold-right"></span
></a>
</div>
</div>
<!--.hover-->
</div>
<!--.team-member-->
</div>
<!--.col-lg-3-->
<div class="col-lg-3 col-sm-6 member-4">
<div class="team-member">
<img
src="http://lvsmiledesigners.com/new/wp-content/uploads/2019/06/nancy.jpg"
data-original="http://lvsmiledesigners.com/new/wp-content/uploads/2019/06/nancy.jpg"
alt=""
class="lazy"
style="display: block;"
/>
<div class="inner">
<h4 class="name">Nancy Gutierrez</h4>
<p class="position">
<small>Lead Back Office Assistant</small>
</p>
</div>
<div class="hover">
<div class="description">
<p>
As Smile Designers of Las Vegas lead dental assistant she says her
coworkers and easy-going patients make it a pleasure to go to work
every day. She loves been a part in patients journeys to a better
and healthier oral health.
</p>
</div>
<div class="read-more">
<a href="/new/karla-brown/" class="button white outline"
>Read more <span class="nc-icon-glyph arrows-1_bold-right"></span
></a>
</div>
</div>
<!--.hover-->
</div>
<!--.team-member-->
</div>
<!--.col-lg-3-->
</section>
Here's the live site: http://lvsmiledesigners.com/new/
The section is under the "Our team can help you!" header. The concern I have is Dr. Amy's div. I'm not sure why Dr. Amy's image is narrower in width than the other images.
[Update]: You should wrap all the doctors column with .team-block-centered to positioning them center. In your demo live site - you only wrap Dr. Amy div.
See your code, all the element with col-lg-3 class aren't siblings, instead Dr. Amy div element nested in .team-block-centered element. And thats the main reason. If you remove parent wrapper with class .team-block-centered, everything will be fine.
[Previous]:
.team-block-centered parent wrapper class has width 900px. And col-lg-3 class take the width of 20%(234px in this case).
The problem is you have 4 column width of 20% * 4 = 80%(234 * 4 = 936px), which is greater than parent wrapper width.
Give .team-block-centered class width: 100% , and then center it.
In other words image is very short in width = 173px original, it should more than 204px.

How to vertically stack bootstrap elements

I've got a header, paragraph and image, and I want them aligned with the header above the paragraph, and the image to the right. When I run it I get the 3 elements in a horizontal row
<div class="container">
<div class="row">
<h1 class="col-xs-3 paddingtop">Joselin</h1>
<p class="col-xs-3 bio">
Growing up in the Caribbean, as a young girl Joselin worked as a
coffee bean picker, giving her a profound insight into using only
the freshest, and highest quality coffee beans.
</p>
<img class="col-xs-6 meetus" src="meetus.jpeg">
</div>
</div>
If the h1 should be above the p and the img, the best thing would be to put it in its own row: <div class="row">. Then put the p and the img in a row right under that.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-xs-6">
<h1 class="paddingtop">Joselin</h1>
<p class="bio">
Growing up in the Caribbean, as a young girl Joselin worked as a
coffee bean picker, giving her a profound insight into using only
the freshest, and highest quality coffee beans.
</p>
</div>
<div class="col-xs-6">
<img class="col-xs-6 meetus" src="meetus.jpeg">
</div>
</div>
</div>
You can then play around with the column sizes (`class="col-xs-3").

Moving a particular column element to the top of a row in bootstrap

I need to align the section information as shown in the figure.
Here's the desktop view :
And here's the mobile view, The Section header "Welcome" should move to the top of the row in the mobile view as shown in the figure
But in my program, it sticks with the paragraph as normally expected and comes down under the image.
NOTE: THE IMAGE SHOWN IS MY DESIRED OUTPUT which I'm not getting.
I am somewhat new to CSS and I need to solve this issue.
Here's my code
.col-centered {
text-align: left;
padding-top: 10px;
padding-bottom: 10px;
}
<div class="row">
<div class="col-sm-5 col-centered">
<img class="img-responsive" src="./Assets/Welcome_image.png" alt="WelcomeImage" />
</div>
<section class="col-sm-7 col-centered">
<h2 id="textheading">Welcome</h2>
<p>Provide highest quality education to students. give studnets more than what we promise them.Children of the ages between 18 months and 6 years are extremely receptive. Kids Planet Kids pre-schools' fun filled programme makes the most of this by encouraging the childrens to understand and develop socail skills, gross and fine major skills and creativity at the same time, throug songs, music and imaginative play.</p>
<p><mark> Read More </mark></p>
</section>
</div>
<div class="row">
<div class="col-sm-5 col-centered">
<img class="img-responsive" src="./Assets/AboutusImage.png" alt="AboutUsImage" />
</div>
<section class="col-sm-7 col-centered">
<h2 id="textheading">About Us</h2>
<p>Kids Planet is a leading education and test preparation comapny, head quartered in Secunderabad, has grown into a specialist, multi-location, multi-programme training provider having 118 cities across India. Kids Planet is a leading education and test preparation comapny, head quantered in secunderanbad. Has grown into a specialist, multi-location, multi-programme training provider having 118 cities across India.</p>
<p><mark> Read More </mark></p>
</section>
</div>
Updated
Now, with new information, you need to make use of the helper classes to Show/Hide elements
I created a duplicate h2 element to show/hide according to the width of the viewport and placed it on top of the image. Like this:
<div class="visible-xs-block col-xs-6 col-xs-offset-3">
<h2 id="textheading">Welcome</h2>
</div>
<div class="col-xs-6 col-xs-offset-3 col-sm-5 col-sm-offset-0">
<img class="img-responsive" src="http://lorempixel.com/300/300" alt="WelcomeImage" />
</div>
<section class="col-xs-6 col-xs-offset-3 col-sm-7 col-sm-offset-0">
<h2 id="textheading" class="visible-sm-block visible-md-block visible-lg-block">Welcome</h2>
...
</section>
I also removed the need for the col-centered and made use of the col-xs-offset-# as needed.
Let me know if this does not work :)
See updated demo:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="row">
<div class="visible-xs-block col-xs-6 col-xs-offset-3">
<h2 id="textheading">Welcome</h2>
</div>
<div class="col-xs-6 col-xs-offset-3 col-sm-5 col-sm-offset-0">
<img class="img-responsive" src="http://lorempixel.com/300/300" alt="WelcomeImage" />
</div>
<section class="col-xs-6 col-xs-offset-3 col-sm-7 col-sm-offset-0">
<h2 id="textheading" class="hidden-xs">Welcome</h2>
<p>Provide highest quality education to students. give studnets more than what we promise them.Children of the ages between 18 months and 6 years are extremely receptive. Kids Planet Kids pre-schools' fun filled programme makes the most of this by encouraging
the childrens to understand and develop socail skills, gross and fine major skills and creativity at the same time, throug songs, music and imaginative play.</p>
<p><mark> Read More </mark></p>
</section>
</div>
<div class="row">
<div class="hidden-sm hidden-md hidden-lg col-xs-6 col-xs-offset-3">
<h2 id="textheading">About Us</h2>
</div>
<div class="col-xs-6 col-xs-offset-3 col-sm-5 col-sm-offset-0">
<img class="img-responsive" src="http://lorempixel.com/300/300" alt="AboutUsImage" />
</div>
<section class="col-xs-6 col-xs-offset-3 col-sm-7 col-sm-offset-0">
<h2 id="textheading" class="visible-sm-block visible-md-block visible-lg-block">About Us</h2>
<p>Kids Planet is a leading education and test preparation comapny, head quartered in Secunderabad, has grown into a specialist, multi-location, multi-programme training provider having 118 cities across India. Kids Planet is a leading education and
test preparation comapny, head quantered in secunderanbad. Has grown into a specialist, multi-location, multi-programme training provider having 118 cities across India.</p>
<p><mark> Read More </mark></p>
</section>
</div>
Old answer deleted after clarifications

Resize Image Div with respect text div next to it

I have design which needs and image and text align next to each other in div(using col-md-6)i need height image to be resize wrt text div.on tablet and mobile it has be 12 column layout
Here is my html code
<div class="row fixed-height">
<div class="col-md-6 full-screen-col img-head"></div><!--col for imag row ends here-->
<div class="col-md-6 cont-bg full-screen-col">
<div class="description_container">
<h1>JOIN OUR TEAM</h1>
<p>We except a lot from our team members, and we give a lot in return- like ongoing training, professional growth
opportunities and competitive benefits. if Gaspar's sounds like your kind of workplace, we'd love to hear from you</p>
</div>
</div><!--container for text details-->
</div><!--row fors slide container -->
Here is css used.
.fixed-height{
height: 300px;
overflow-y: hidden;
}
.img-head{
background-image: url(../images/Gaspars-Construction-Employee-Photo-1024x683.jpg);
background-size: cover;
height: 100%;
}
Little help is much appreciated. Thanks in advance
Add this,
<div class="row fixed-height">
<div class="col-md-6 col-sm-6 full-screen-col img-head"></div><!--col for imag row ends here-->
<div class="col-md-6 col-sm-6 cont-bg full-screen-col">
<div class="description_container">
<h1>JOIN OUR TEAM</h1>
<p>We except a lot from our team members, and we give a lot in return- like ongoing training, professional growth
opportunities and competitive benefits. if Gaspar's sounds like your kind of workplace, we'd love to hear from you</p>
</div>
</div><!--container for text details-->
</div><!--row fors slide container -->
This should work:
HTML
<div class="row fixed-height">
<div class="col-md-6 full-screen-col img-head">
<img src="https://dncache-mauganscorp.netdna-ssl.com/thumbseg/308/308116-bigthumbnail.jpg"/>
</div><!--col for imag row ends here-->
<div class="col-md-6 cont-bg full-screen-col">
<div class="description_container">
<h1>JOIN OUR TEAM</h1>
<p>We except a lot from our team members, and we give a lot in return- like ongoing training, professional growth opportunities and competitive benefits. if Gaspar's sounds like your kind of workplace, we'd love to hear from you</p>
</div>
</div><!--container for text details-->
</div><!--row fors slide container -->
CSS
.img-head{
float: left;
}

Test doesn't stack when screen is minimized bootstrap 3

Ok so I have the following HTML
<div class="container">
<div class="row col-sm-12" id="productBrief">
<div id="RaspberryAndChocolate" style="display:none; height:200px;">
<div class="col-sm-6 text-center">
<img src="~/Content/Images/YogurtImages_404x290/Rasberry_White_Chocolate_Yogurt.png" class="img-responsive" style="margin: 0 auto; padding-top: 5%" alt="Rasberry White Chocolate Yogurt" />
</div>
<div class="col-sm-6">
<h2 class="raspberryRed productLineHeight">FLAVOUR #3</h2>
<h1 class="raspberryRed">
RASPBERRY &<br /> WHITE CHOCOLATE
</h1>
<p class="productPara">
A decadent combination of whole raspberries and smooth white chocolate that you will want to make last as long as possible. Teaspoon recommended.
</p>
<p>
<span class="label label-danone label-as-badge" style="font-size: 0.9em; padding:3%">VIEW ALL FLAVOURS</span>
</p>
</div>
</div>
<div class="clearfix"></div>
<div id="BlueBerry" style="display:none; height:200px;">
<div class="col-sm-6 text-center">
<img src="~/Content/Images/YogurtImages_404x290/Blueberry_Yogurt.png" class="img-responsive" style="margin: 0 auto; padding-top: 5%" alt="Blueberry Yogurt" />
</div>
<div class="col-sm-6">
<h2 class="blueBerry productLineHeight">FLAVOUR #6</h2>
<h1 class="blueBerry">
BLUEBERRY
</h1>
<p class="productPara">
Just imagine plump and juicy blueberries immersed in a deliciously creamy yoghurt. Enough said.
</p>
<p>
<span class="label label-as-badge" style="font-size: 0.9em; padding:3%">VIEW ALL FLAVOURS</span>
</p>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-lg-12 text-center">
<div class="col-lg-2"></div>
<p style="width:70%;" class="text-center col-lg-8">
Experiencing Ultimate's uniquely luscious texture for the first time is beyond words. So don't even try. Take a moment to enjoy the ultra creaminess, the juicy ripened fruits and an array of wicked indulgences that come together to create a yoghurt like no other.
</p>
<div class="col-lg-2"></div>
</div>
</div>
Now there are roughly about 8 different divs but for simplicity I am only showing 2, but only one div is shown look at it as a random affect so the user refreshes the page a different div is shown (this is done in jquery) but if you look at the bottom of the HTML you will see another row with a P tag this is what is causing he issue, when displayed on a desktop it shows like this
when I minimize the browser the text at the bottom of the image displays under the text located to the right hand side of the yogurt box as shown here.
I have added the clearfix, tried adding a new container and yet the problem still remains....
You are using invalid bootstrap grid. Col should be a child of row. Use correct grid and everything will work perfectly.
Scott, hunzaboy says you need to use the dive like this
<div class="row">
<div class="col-sm-12"></div>
</div>
I don't fully understand your question, but hope you asking this,
when re-sizing your first image, I will suitably re-size without any harm to other divs. For that You need to devide that into 3 main divs, check the below code
<div class="row">
<div class="col-md-6">This is the image holding div</div><div class="col-md-6"> this is the right side text "Flavour #6, etc..."</div>
<div class="col-md-12">This is the text on the bottom</div>
</div>
I will look, 2 columns on the top and one column in the bottom.
For mobile view, you can use col-xs-12class, the it will show as stack.
Hope this is you asking. Thanks