Bootstrap "container" background - html

I've been racking my brains for quite a bit of time but still was not find to find a variant but one I will describe here.
I’m using twitter bootstrap 2.3.2. I wanted to change the background of the "container". When I applied the changes, this image was also the background of "navbar" and "hero-unit".
The same thing you can discover here:
http://getbootstrap.com/2.3.2/examples/hero.html
By setting in the "Inspect Element" of the "container" settings smth like this:
background-image: ('url');
It will not only set the image of the body, but also of the "navbar".
Surely, I clearly understand why, in my case, the background of "navbar" and "hero-unit" are changing, because I got this in the HTML:
<div class="container">
<div class="navbar">
<div class="hero-unit">
</div>
</div>
</div>
But what I need, is that the "hero-unit" and the main content "container" were on one line (as on the link provided above). If they are applied to the "container" class it works, but the background is fairly. What properties do I have to apply to the new class, so as they are of equal size (see the link). I think I'm stuck a bit and badly need some support.
I guess I gotta create two new classes? One for the equal display of the "container" and "hero-unit" and "navbar" and the other (with same property of width) to set the background. But I cant figure it out:(

There's an easy fix for your issue.
Use proper markup. It makes no sense to put a hero-unit inside of a navbar and after that put said navbar inside of your container.
<div class="navbar">
<!-- Other stuff -->
</div>
<div class="container">
<div class="hero-unit"></div>
</div>
This is the markup you should use. Then you can create a separate class with your CSS properties and add that class to your DIV with the container class.

Related

Not able to give header and div the same background image

I am using WordPress and I want to make the header and the div below it to share the same background image.
I have added the div in the WordPress page using Visual Composer and given it a background image, but the only way I can make it go into the background of the nav is by giving it a negative margin-top value, which of course makes it non responsive. Could anyone give me any pointers?
Since you dont have any code, i cant really SEE what you want to do but, i assume what you need to do is something like this
<div id="mainTOPwrapper">
<div id="header">header content here</div>
<div id= "divBelowIt"> lolz at the div name =) </div>
</div>
And then, you give the background image css to "mainTOPwrapper". Make sure the divs within it dont have any backgrounds, and this will work for you

Bootstrap container not see-thru?

I have a fullscreen Bootstrap container that's sitting in front of a color overlay I added. But it seems that the container blocks the overlay even though it is mostly empty, why is that so? I need it behind my container as the img inside the container needs to be on top of the color. The html's body's color is coming through, though. But I need both the html's body color and also the overlay to be seperate as I'm slowly fading the overlay out to show the body color... Wondering if it sounds confusing. =x Thanks in advance!
<div class="container-fluid">
<div class="row row-xs-center">
<div class="col-xs-12 text-xs-center">
<img src="../img/cover_coral.png" id="myCover">
</div>
</div>
</div>
<div id="myOverlay"></div>
Using Bootstrap's container-fluid class will cause your div tag to span the width of the page (with a bit of padding applied). If you have an overlay you want to show in front of it, your best option is to use CSS to add a z-index of say 2000 (any large number will do). When you fade out, simply animate the opacity of the overlay and/or change the z-index so it's behind the container.

Set border image over previous div to make peek kind of effect for image

Sorry guys I made new one for this because it couldn't be done like I previously explained.
I want image to go over previous div and so it stays always at the same exact spot.
It's an border image for portfolio div what I'm trying to align here correctly, so that it makes peek kind of effect over previous div.
<div id="previous">some content</div>
<div id="portfolio">
<div class="some-other-content">Whole lot of html</div>
</div>
Link to my jsfiddle
Use in your CSS
"position:absolut" to set a fix position in your Window.
see more options here:
http://www.css4you.de/position.html

Having issues adding full width slider or image to twitter bootstrap theme

I am working on converting a twitter bootstrap theme into a wordpress theme and adding onto it.
I am having issues adding full width items into the theme. I have tried adding a slider plugin that is set to full width. Although when it is added it goes to a fixed width, the same happens if I add an image aswell. It seems all of the content in my page does this except for my header and footer.
Also it seems every time I add in anything to the page the page/footer gets messed up. I am still learning css though.
I am posting a link to the site to see if anyone can take a look and give me a hand.
http://goo.gl/8JUDA
It looks like you contained the element that you want to stretch the size of the window within a .container div.
.container is used in bootstrap for fixed layouts. Instead try using the .container-fluid class.
For example:
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<!--Sidebar content-->
</div>
<div class="span10">
<!--Body content-->
</div>
</div>
</div>
Read more: http://twitter.github.io/bootstrap/scaffolding.html#layouts

div's contents showing, but not the div "box"

On my wordpress built site, with a Responsive theme child theme, there is a div which contains widgets.
The widgets and their content are showing fine, but the "wrapping" div is not showing what I have styled via css. If I use firebug, I can see that the div is appearing up at the same spot as another div "featured", but is obviously behind it. Well, I need it to be below.
The site is http://thelawcompany.com.au.
The problem div is <div id="widgets" class="home-widgets">. I want the background and top-border that I have declared in CSS to appear behind the widgets. Also, there is a massive gap below the widgets that I can't seem to get rid of.
It because the #featured element is floated.
A solution is to float the widgets also by adding the class grid
Demo: Problem, Solution
<div id="widgets" class="home-widgets grid">