How to make one background mild between two background in Homepage? - html

So I added Two background in Homepage. One is Blue shade and another is an Image. I want to That Blue shade to see more that image. How can I do it.
HTML:
<div class="banner banner-4 banner-4-bg">
<div class="container">
<div class="row">
<div class="col-12">
<div class="banner-content">
<h1>The Easiest Way to Find Job</h1>
<p>Find Jobs, Employment & Career Opportunities</p>
<div class="banner-search">
<form action="#" class="search-form">
<input type="text" placeholder="Enter Keywords">
<select class="selectpicker" id="search-location">
<option value="" selected>Location</option>
<option value="california">California</option>
<option value="las-vegas">Las Vegas</option>
<option value="new-work">New Work</option>
<option value="carolina">Carolina</option>
<option value="chicago">Chicago</option>
<option value="silicon-vally">Silicon Vally</option>
<option value="washington">Washington DC</option>
<option value="neveda">Neveda</option>
</select>
<button class="button primary-bg"><i class="fas fa-search"></i>Search Job</button>
</form>
<div class="trending-key">
<span>Trending Keywords:</span>
designer
php
ios
Android
Accounting
Management
</div>
</div>
</div>
</div>
</div>
</div>
</div>
MY CSS:
.banner-4-bg {
background: url(../images/bg/banner_home.png) , url(../images/bg/banner-4-bg.jpg) no-repeat center;
background-size: cover;
}
.banner-4 .banner-content {
padding: 290px 0 210px;
text-align: center;
color: #ffffff;
}
What I have now :
And What I want:
Help me out Good people :)

There are different ways to do it:
Modify the image and make the same as displayed in the second one.
Make another div same width and height as image and {position: absolute} such that it overlaps the image then { background-color: 'some gray or black color', opacity: 0.5 } (adjust opacity and background-color accordingly). also, write all the displaying content on the banner in this div.

You can adjust the transparency of an image by using CSS opacity, where opacity is between 0.0 - 1.0 and the lower value, the more transparent, e.g.:
.banner-4-bg {
background: url(../images/bg/banner_home.png) , url(../images/bg/banner-4-bg.jpg) no-repeat center;
background-size: cover;
opacity: 0.5;
}
.banner-4 .banner-content {
padding: 290px 0 210px;
text-align: center;
color: #ffffff;
}

Here you go(view it in full screen mode):
I tried to get the images you shared and used it may the clarity is not clear. You may need to use the texts field as you want. As I mentioned in comments interchange the background:urls that should fix for you.
When using the multiple background images, images will be stacked upon each other and the first is the closest to the view.
.banner-4-bg {
background: url(https://i.postimg.cc/DyJRcGNB/Px3iz.png), url(https://i.postimg.cc/wTL0vQZ8/azHDz.jpg) no-repeat center;
background-size: cover;
}
.banner-4 .banner-content {
padding: 290px 0 210px;
text-align: center;
color: #ffffff;
}
<div class="banner-4-bg">
</div>
<div class="banner banner-4 banner-4-bg">
<div class="container">
<div class="row">
<div class="col-12">
<div class="banner-content">
<h1>The Easiest Way to Find Job</h1>
<p>Find Jobs, Employment & Career Opportunities</p>
<div class="banner-search">
<form action="#" class="search-form">
<input type="text" placeholder="Enter Keywords">
<select class="selectpicker" id="search-location">
<option value="" selected>Location</option>
<option value="california">California</option>
<option value="las-vegas">Las Vegas</option>
<option value="new-work">New Work</option>
<option value="carolina">Carolina</option>
<option value="chicago">Chicago</option>
<option value="silicon-vally">Silicon Vally</option>
<option value="washington">Washington DC</option>
<option value="neveda">Neveda</option>
</select>
<button class="button primary-bg"><i class="fas fa-search"></i>Search Job</button>
</form>
<div class="trending-key">
<span>Trending Keywords:</span>
designer
php
ios
Android
Accounting
Management
</div>
</div>
</div>
</div>
</div>
</div>
</div>

Related

How to put two select attributes (which are in different forms) side by side using html & css

I need to put two select types side by side which re in different forms
Float and span are not working, I have also tried position-property but of no use.
Below is the HTML code,
form.aui .field-group {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 4px 0 4px 145px;
position: fixed;
left: 50%;
margin: 1px 0;
width: 100%
}
<div class="xyz-page-panel">
<div class="xyz-page-panel-inner">
<section class="xyz-page-panel-content">
<div id="searchType">
<form class="xyz">
<div class="field-group">
<label for="one-two-id">Search Type </label>
<select name="searchType" class="select long-field" id="one-two-id">
<option value="one">one</option>
<option value="two">two</option>
</select>
</div>
</form>
</div>
<div>
<form class="xyz">
<div class="field-group">
<label for="search-options-id">Search field </label>
<select class="select long-field" id="productName">
<option value="one">one</option>
<option value="two">two</option>
</select>
</div>
</form>
</div>
</section>
</div>
</div>
By using
.xyz-page-panel-content {
display: flex;
}
It's important that you recognize the elements in your structure that are siblings. In your case it's
<div class="xyz-page-panel">
<div class="xyz-page-panel-inner">
<section class="xyz-page-panel-content">
<!-- sibling 1 -->
<div id="searchType">
<!-- ... -->
</div>
<!-- sibling 2 -->
<div>
<!-- ... -->
</div>
</section>
</div>
</div>
For display: flex to work, you must assign this rule to the parent element of those who are meant to be next to each other. If those are not siblings, you have to use some other strategy or change the HTML structure.
You could use float instead by floating the siblings. I don't like using float for layout purposes like these, so I don't show it in action.
.xyz-page-panel-content > * {
float: left ;
}
form.aui .field-group {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 4px 0 4px 145px;
position: fixed;
left: 50%;
margin: 1px 0;
width: 100%
}
.xyz-page-panel-content {
display: flex;
}
<div class="xyz-page-panel">
<div class="xyz-page-panel-inner">
<section class="xyz-page-panel-content">
<div id="searchType">
<form class="xyz">
<div class="field-group">
<label for="one-two-id">Search Type </label>
<select name="searchType" class="select long-field" id="one-two-id">
<option value="one">one</option>
<option value="two">two</option>
</select>
</div>
</form>
</div>
<div>
<form class="xyz">
<div class="field-group">
<label for="search-options-id">Search field </label>
<select class="select long-field" id="productName">
<option value="one">one</option>
<option value="two">two</option>
</select>
</div>
</form>
</div>
</section>
</div>
</div>
Try to float the divs outside the form tags. This should work.
#searchType {
float:left;
}
Like this

How to increase width of select box arrow?

I want to increase the width of select box arrow like fa fa caret. i am not getting it how to do. I used img tag inside the each field and given position absolute and adjusted with left top properties but i think this is not proper way of doing this and even i click on the image arrow not select options are opening so i removed this. Please tell me proper solution for it.
.search-categories{
background: #E40444 !important;
color: #fff !important;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<style type="text/css">
</style>
<div class="col-md-12 ">
<div class="row">
<form action="#" method="get" id="search_mini_form">
<div class="col-sm-offset-2 col-sm-2 catnames">
<select name="cat" class="form-control search-categories">
<option>Categories</option>
<option value="3">abcd</option>
<option value="4">abcd</option>
<option value="5">abcd</option>
</select>
</div>
<div class="col-sm-2 catnames catnames-arrow ">
<select name="cat" class="form-control search-categories search-Hourly">
<option>Hourly</option>
<option value="3">abcd</option>
<option value="4">abcd</option>
<option value="5">abcd</option>
</select>
</div>
<div class="col-sm-4 catquery ">
<div class="input-group">
<input type="search" class="form-control " name="q" id="location" value="" maxlength="128" placeholder="Search Place..." autocomplete="off" />
<div class="input-group-addon catsubmit"><i class="fa fa-search"></i></div>
</div>
</div>
<div id="search_autocomplete" class="search-autocomplete"></div>
</form>
</div>
</div>
You can use the css triangle to make the arrow.
HTML
<div class="selectwrap">
<select>
<option>Option 1</option>
<option>Option 3</option>
<option>Option 4</option>
</select>
</div>
CSS
select {
border: 1px solid #ccc;
height: 34px;
width: 250px;
padding: 6px 12px;
line-height: 1.42857143;
}
.selectwrap {
position: relative;
float: left;
}
.selectwrap:after {
content: "";
position: absolute;
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-top: 8px solid #000;
right: 4px;
top: 14px;
pointer-events: none;
}
It's very complicated to style form elements cross-browser because very browser has different look for form elements (especially checkbox, radio, select, progress).
I suggest using some plugin like select2 so you can easily style very element browser-independent.
$(document).ready(function() {
$('select').select2({
width: '200px'
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="http://select2.github.io/select2/select2-3.5.3/select2.css" rel="stylesheet" />
<script src="http://select2.github.io/select2/select2-3.5.3/select2.js"></script>
<select>
<option>Op 1</option>
<option>Op 2</option>
<option>Op 3</option>
<option>Op 4</option>
</select>
better use some select element customisation plugin like select2, selectize. The appearance that these plugins create can be customised through css.
You cannot fully control the appearance of select element in cross browser manner with css alone.

div is not responding to display:block;

I have this set up where I'm switching the display to be responsive, I have two set of nav menus one is displayed and the other is hidden on page load, once the screen is 480px or below the main site nav menu acts as expected and is hidden, but the mobile nav wont show up.
here is my code below and thanks in advance.
#media screen and (max-width: 480px) {
.mn-nav {
display: block;
}
.main-site-nav {
display: none;
}
}
<div class="container">
<div class="mn-nav" style="display:none;">
<div class="col-md-12">
<select width="100%" name="m-nav">
<option value="select">Profile Menu</option>
<option value="social">Social</option>
<option value="profile">My Profile</option>
<option value="media">My Media</option>
</select>
</div>
</div>
<div class="main-site-nav">
<div class="col-md-3">
<button id="social-button" style="width:100%;" class="btn btn-primary">Social</button>
</div>
<div class="col-md-3">
<button id="profile-button" style="width:100%;" class="btn btn-primary">My Profile</button>
</div>
<div class="col-md-3">
<button id="media-button" style="width:100%;" class="btn btn-primary">My Media</button>
</div>
<div class="col-md-3">
<a href="/logout">
<button style="width:100%;" class="btn btn-danger">Logout</button>
</a>
</div>
</div>
</div>
The style is applied, but your inline display style takes precedence over the one in the style sheet, making it redundant. Remove the inline style and add it in the stylesheet before your media query:
HTML
<div class="mn-nav" style=""><!-- Inline style removed -->
<div class="col-md-12">
<select width="100%" name="m-nav">
<option value="select">Profile Menu</option>
<option value="social">Social</option>
<option value="profile">My Profile</option>
<option value="media">My Media</option>
</select>
</div>
</div>
CSS
.mn-nav{
display: none;
}
#media screen and (max-width:480px) {
.mn-nav {
display:block;
}
.main-site-nav {
display:none;
}
}
Bootply
This happens because you set display: none; as inline style.
html:
<div class="mn-nav">
<div class="col-md-12">
<select width="100%" name="m-nav">
<option value="select">Profile Menu</option>
<option value="social">Social</option>
<option value="profile">My Profile</option>
<option value="media">My Media</option>
</select>
</div>
</div>
css:
.mn-nav {
display: none;
}
#media screen and (max-width:480px) {
.mn-nav {
display: block;
}
.main-site-nav {
display: none;
}
}
Your inline style has priority over the styles you set in your css file. Therefore display: block is not being applied.
The problem is that in <div class="mn-nav" style="display:none;">, the style has a higher priority than a style in a CSS style sheet.
Move it to
.mn-nav{
display:none;
}
and you are good.
Reference: CSS which takes precedence, inlne or the class?

How to make Dropsdownlist + text inline under 768px?

I'm trying to make my dropdownlists I have created to be on the same line under 768px.
Right now, I'm using the form-inline, but that only works over 768px and not under.
Can any tell me how this can be done? Have tried with a list, but that did not work well.
As you can see in the fiddle, I want some text over each dropdownlist. I know i'm not using an label, cause this makes
My Jsfiddle
<div class="col-xs-12">
<div class="form-inline">
<div class="form-group">
Adult<br />
<select class="dropdown" id="Dropdown-adult">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</div>
<div class="form-group">
Child (3-15)<br />
<select class="dropdown" id="Dropdown-child">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
<div class="form-group">
Infant (0-3)<br />
<select class="dropdown" id="Dropdown-infant">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
<div class="form-group">
Pet<br />
<select class="dropdown" id="Dropdown-pet">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
</div>
<div class="form-group">
<div class="padding-top15">
<button type="submit" class="bookingbutton">BOOK NOW</button>
</div>
</div>
</div>
Hope someone can tell me what I should look at.
Updated:
I think you guys have misunderstood what I was trying to tell. Right now when viewing the page over 768px the dropdownlists are inline as they should be.
If the webpage goes under 768px, all the dropdownlists going out of the inline, which it should not do. I just want to use 2 lines instead of 5-8
I just want it to look the same as it does over 768px. I have uploaded the image of how it should look like under 768px.
It's because Bootstrap add classes to make a responsive grid. If you want your lists to be always on the same line just add this in you css:
.form-group{
display:inline-block
}
JS Fiddle: https://jsfiddle.net/f8gfa768/1/
If I understood you correctly, you want to achieve under 768px width:
[text] [dropdown] <!-- new line -->
[text] [dropdown] <!-- new line -->
[text] [dropdown] <!-- new line -->
[text] [dropdown] <!-- new line -->
Those br tags are messing up your styles. Why don't you remove them, and add display: block/inline-block styles to select element, depending on the window width, which will replace that br:
select{
display: inline-block;
}
#media (min-width: 768px){
select{
display: block;
}
}
#Dropdown-adult {
height: 30px;
font-size: 15px;
width: 45px;
}
#Dropdown-child {
height: 30px;
font-size: 15px;
width: 80px;
}
#Dropdown-infant {
height: 30px;
font-size: 15px;
width: 80px;
}
#Dropdown-pet {
height: 30px;
font-size: 15px;
width: 45px;
}
#Dropdown-vehicles {
max-width: 100%;
height: 30px;
width: 100%;
font-size: 15px;
}
.bookingbutton {
background-color: #F6861F;
border-style: none;
height: 30px;
width: 110px;
color: white;
font-size: 15px;
text-align: center;
font-weight: bold;
font-family: 'Open Sans', sans-serif;
}
.padding-top15 {
padding-top: 15px;
}
select{
display: inline-block;
}
#media (min-width: 768px){
select{
display: block;
}
}
<div class="col-xs-12">
<div class="form-inline">
<div class="form-group">
Adult
<select class="dropdown" id="Dropdown-adult">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</div>
<div class="form-group">
Child (3-15)
<select class="dropdown" id="Dropdown-child">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
<div class="form-group">
Infant (0-3)
<select class="dropdown" id="Dropdown-infant">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
<div class="form-group">
Pet
<select class="dropdown" id="Dropdown-pet">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
</div>
</div>
<div class="form-group">
<div class="padding-top15">
<button type="submit" class="bookingbutton">BOOK NOW</button>
</div>
</div>
</div>
JSFiddle

div outside the parent div

i'm trying to create a page structure, but i have a problem with position of div.
I have 2 div (purple) into a div parent (red). And after parent div, another div (green). I want to have the green div bottom the red one.
But the browser show me the purple div not into the red one (their parent), and so the green div is not under the red and purple divs, but only under the red one.
I make a snippet to show you:
div#form {
background: red;
}
div#search {
background: yellow;
}
div.accostati {
float: left;
margin: 5px;
background: purple;
}
div#test {
background: green;
}
<div id="form">
<p> CERCA GOMME </p>
<div id="label-search" class="accostati">
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
</div>
<div class="accostati">
<form name="cercaGommeCasa" action="gommeincasa.php" method="POST">
<select name="marca">
<option value="1">1</option>
</select><br>
<select name="modello">
<option value="2">2</option>
</select> <br>
<input type="submit" value="CERCA">
</form>
</div>
</div>
<div id="test">
riga1 <br>
riga2 <br>
riga3 <br>
</div>
Have you any idea how to show the purple div into the red one, in order to have green div under both purple and red divs...
Thank you!
Add overflow:auto to div#form:
div#form {
background: red;
overflow:auto;
}
div#form {
background: red;
overflow:auto;
}
div#search {
background: yellow;
}
div.accostati {
float: left;
margin: 5px;
background: purple;
}
div#test {
background: green;
}
<div id="form">
<p> CERCA GOMME </p>
<div id="label-search" class="accostati">
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
</div>
<div class="accostati">
<form name="cercaGommeCasa" action="gommeincasa.php" method="POST">
<select name="marca">
<option value="1">1</option>
</select><br>
<select name="modello">
<option value="2">2</option>
</select> <br>
<input type="submit" value="CERCA">
</form>
</div>
</div>
<div id="test">
riga1 <br>
riga2 <br>
riga3 <br>
</div>
You can use display: inline-block for both those divs
Like this
div#form {
background: red;
display: inline-block;
}
div.accostati {
display: inline-block;
margin: 5px;
background: purple;
}
div#form {
background: red;
display: inline-block;
}
div#search {
background: yellow;
}
div.accostati {
display: inline-block;
margin: 5px;
background: purple;
}
div#test {
background: green;
}
<div id="form">
<p> CERCA GOMME </p>
<div id="label-search" class="accostati">
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
<p class="select">LABEL-FIELD:</p><br>
</div>
<div class="accostati">
<form name="cercaGommeCasa" action="gommeincasa.php" method="POST">
<select name="marca">
<option value="1">1</option>
</select><br>
<select name="modello">
<option value="2">2</option>
</select> <br>
<input type="submit" value="CERCA">
</form>
</div>
</div>
<div id="test">
riga1 <br>
riga2 <br>
riga3 <br>
</div>