Inserting Search box into header image - css

I am looking to insert/move my search bar into my header image similar to the example below. If someone had a minute to show me how to accomplish this it would be greatly appreciated. Thanks for your time. Here is the link to my website http://www.jobspark.ca/
Chris

Just add your search box inside
<div id="logo" class="image">
...
<h1>
...
</h1>
"search box code goes here"
</div>
Give an id in the search div and Finally position using CSS padding.

you can keep the background image into body tag. set no repeat, use background-size to 100% width.
example:
body{
backgroud-image:url() no-repeat center;
background-size: --;
}
HTML STRUCTURE:
<div id="header">
<div ="#">
<h1></h1> //float:left
<div id="menu"></div> //float:right;
</div>
<div ="search-box">
<form>
</form> //use margin and padding for keep it center;
</div>
</div>

Related

Overlay not affecting all areas of page

I'm trying to apply an overlay to create an effect similar to https://fancy.com when the login or signup link is clicked i.e the background should be dimmed.
The problem is that my nav bar and content boxes are not subjected to the overlay for some reason but not sure why?
I have created a fiddle to explain: https://jsfiddle.net/p861yfLp/1/
My Code:
<body>
<div class="overlay">
<nav>
Menu
</nav>
<div id="content">
<div class="box">
Box
</div>
</div>
</div>
</body>
Change these files
CSS - set the position to absolute
.overlay {
position: absolute;
}
EDIT: Following #DaniP answer the changes to the css are not required if you want a 'modal' feel for the overlay. Tho if you want to overlay everything I would recommend using the absolute position.
HTML - no need to make your overlay contain all other html
<body>
<div class="overlay"></div>
<nav>
Menu
</nav>
<div id="content">
<div class="box">
Box
</div>
</div>
</body>
Now your overlay will 'overlay'.
The half-black background-color is actually applied, but the nav (as child-element) has its own background-color (#FFF) defined. If you remove its background-color, it works:
.nav {
background-color: transparent;
}
https://jsfiddle.net/rw60gzbz/

Resize Responsive image without stretch + zoom effect on image link

I have been searching for answers everywhere and can't find one that fits my needs. So I created a Fiddle to explain what I want to achieve: http://jsfiddle.net/Fran6/jbo5pfs4/3/
HTML:
<div class="col1">
<img></img>
<h1>Title 1</h1>
</div>
<div class="col2">
<div class="box1"><img></img>
<h1>Title 2</h1>
</div>
<div class="box2"><img></img>
<h1>Title 3</h1>
</div>
<div class="box3"><img></img>
<h1>Title 4</h1>
</div>
</div>
I have containers positioned on the page. They have images and I would like to have them not stretched. I actually would like the same effect than for background-image: cover. That is my first question.
Then, I would like to have a zoom effect on the image when I hover it, via the link that is implemented with the title.
I can achieve these things separately but not together. Also, I started by using background images instead of in HTML but could not do the zoom effect.
So if anyone could help me solve my problem, that would be very nice !! :-)
Thanks !
I can complete the background-image: cover. Create a html tag with a id of 'cover' like so...
<div id="cover">
<!-- content -->
</div>
Then, you need to do the following in CSS.
#cover {
padding: 0, 0, 0, 0;
background: url(http://placehold.it/300x150) top left no-repeat;
background-size: cover;
height: 300px;
}
I would imagine to do the zoom effect, you could possibly use :hover although I'm not 100% sure.
Hope this helps though.

bootstrap 3 full width image and div in container

I'm trying to set some divs to width: 100% on Twitter Bootstrap 3 (including no paddings or margins).
JSfiddle: http://jsfiddle.net/rq9ycjcx/
HTML:
<div class="container">
<header>
<div class="row">
<div class="col-md-2">
<img src="http://placehold.it/150x50">
</div>
<div class="col-md-10">Menu</div>
</div>
<div class="row gray">
<div class="col-md-6">
<h1>Page Title</h1>
</div>
<div class="col-md-6">
<div class="breadcrumbs">Main page > page </div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<img src="http://placehold.it/350x150" />
</div>
</div>
</header>
<footer>
<div class="row">
<div class="col-md-12">Content</div>
</div>
<div class="row dark">
<div class="col-md-3">Footer 1</div>
<div class="col-md-3">Footer 2</div>
<div class="col-md-3">Footer 3</div>
<div class="col-md-3">Footer 4</div>
</div>
</footer>
</div>
What is the right way to get image http://placehold.it/350x150 width: 100%, including no paddings or margins?
Page title and breadcrumbs height is 80px.
If I resize window to smaller screen (e.g. mobile), text Main page > page disappears (it's somewhere but not on own row).
How to fix it?
Use <div class="container-fluid">. As per Bootstrap Docs: Use .container-fluid for a full width container, spanning the entire width of your viewport.
There is 0 padding on container-fluid.
In your code you have what appears to be body content in your header and you also have a div class="container" outside of your header and footer. This is not correct, you should have your container/container-fluid inside of your body. Also for your header you should use <nav="nav navbar-nav">.
Updated Fiddle
As suggested above, you can create a helper class
.padding-0 {
padding: 0;
}
and apply it to any HTML elements for which you need a padding reset. So in your case, it would look like this:
<div class="row">
<div class="col-md-12 padding-0">
<img src="http://placehold.it/350x150" />
</div>
</div>
For the second problem, set height of .gray class to auto :
#media () {
.gray {
height: auto;
}
}
Note: You could also remove line-height: 80px, it's optional :)
http://jsfiddle.net/rq9ycjcx/8/
There is no "right" way to do that in Bootstrap 3. It means you have to reset padding for the exact column.
You can create a class such as this one:
.col-md-12.resetPadding { padding:0px }
About Main page > page disappearing, I don't see this problem on my browsers (tested on Chrome and FF), but you have line-height: 80px there and as you said your breadcrumbs div has height: 80px;, so try to reduce line-height property and see how it works.
A simple way would be to remove the <div class="col-md-12">...</div> and add your content directly inside the row tag. The row tag removes the left & right gutters, whereas the cold-md-12 essentially adds the gutters back in.
The Bootstrap 3 documentation says that for single full width items you don't need any markup, eg just wrap it in <p> tags. However this will show the 15px gutters due to the page markup. So by simply adding in the row tag and placing your content directly inside this you will get 100% width content and be compliant with the BS3 documentation.

total confusion with Bootstrap and Wordpress

Done this a whole bunch of times, but now it's acting out for some reason. Though I'll probably feel very dumb, after somebody points out the mistake.
Live link:
http://soloveich.com/project6
I'm trying to build a header, but getting quite a few problems at the same time
1) Background images for class header and #soc don't show
2) that image with large text does not align to center
3) I get the post on the right side of the header, while it has to be under it.
css is properly connected (tried changing body background color)
header code
<div class="header">
<header>
<div class="row-fluid">
<div class="col-lg-3"><div class="pull-right"><img src="wp-content/themes/greendream/images/logo.png"> </div></div>
<div class="col-lg-6"><div id="text"><img src="wp-content/themes/greendream/images/text.png"></div></div>
<div class="col-lg-3"><div id="soc"></div></div>
</div>
</header>
</div>
css
.header {
background-image: url(images/hdbg.jpg);
}
#text {
width: 578px;
margin:o auto;
}
#soc {
background-image: url(images/soc.png);
}
You need to start by studying how the grid system in Bootstrap 3 works.
Basically, if you want your content centered, you need to place it in a container. Then you set up your rows and columns.
Something like this:
<body>
<div class="container">
<div class="row">
<div class="col-md-3">
<img src="wp-content/themes/greendream/images/logo.png">
</div>
<div class="col-md-6">
<img src="wp-content/themes/greendream/images/text.png">
</div>
</div>
</div>
</body>
Note: There is no row-fluid in Bootstrap 3. A lot of what you're trying to do will only work in Bootstrap 2.

CSS sprite problem, screwing up layout

I'm trying to update some code to use CSS sprites. In some situations it works fine, in others it screws up the page layout, and I can't figure out what I'm doing wrong.
Here's a fragment of the html ....
<div id="footer"><!-- footer -->
<div class="footer-top">
<div class="footer-left">
<div class="footer-right">
<img src="footer-logo.gif" />
<br /><br />
<div>
<p>blah blah blah</p>
<div class="clearfloat"></div>
</div>
</div>
</div>
</div>
... and the CSS:
.footer-left {
background: url(/images//footer-left_.gif) no-repeat left top;
}
I've created my sprite, and tried changing the CSS to:
.footer-left {
background:url('/images/sprites.gif') -66px -2px no-repeat;
width:20px;
height:99px;
}
The dimensions and offsets are correct, but the result isn't pretty. The sprite region shows in roughly the right place, but footer-logo.gif and the text are messed up.
Any ideas please?
The only things that have any effect on the logo and the text, are the dimensions you added; you set the width of the footer to 20px and if that wasn´t there before, that definitely has an effect on your bla bla bla text and .footer_right.
Note that .footer_right and the text are both located inside your 20px wide footer_left.
Are you sure your nested div structure is correct?

Resources