Parallax Image doesn't fill the width - Materialize - html

I'm having this problem where the picture stays to the left, I've already initialized it in my js, I tried changing the size of the picture, used different browsers, and it has the same result. Can somebody help me in solving this?
HTML
<nav class="#607d8b blue-grey">
<div class="nav-wrapper container">
<!-- Interaq-->
<ul class="left hide-on-med-and-down">
<li>HOME</li>
<li>GAMELIST</li>
<li>REVIEWS</li>
<li>NEWS</li>
<!-- Dropdown Trigger -->
<!-- <li><a class="dropdown-button" href="#!" data-activates="dropdown1">Dropdown<i class="material-icons right">arrow_drop_down</i></a></li>-->
</ul>
<!--Search bar-->
<form class="right hide-on-med-and-down">
<div class="input-field">
<input id="search" type="search" required>
<label for="search"><i class="material-icons">search</i></label>
<i class="material-icons">close</i>
</div>
</form>
</div>
</nav>
<div class="parallax-container">
<div class="parallax"><img src="<?php echo base_url();?>materialize/img/banner1.jpg"></div>
</div>
Result

Try this out. Mistake was equal sign after width property in Krushio Vida's answer.
<div style="width:100%;" class="parallax-container">
<div class="parallax">
<img src="<?php echo base_url();>materialize/img/banner1.jpg">
</div>
</div>
Here is, jsfiddle

Try to set width style to 100% directly at the divs e.g.
<div style="width:100%" class="parallax-container">
<div style="width:100%" class="parallax"><img style="width=100%" src="<?php echo base_url();?>materialize/img/banner1.jpg"></div>
</div>

You should make your image responsive with a class="responsive-img"
<img class="responsive-img" alt="parallax" src={img} />

float:right is applied to the form instead of input-field.
<form class="right hide-on-med-and-down">
<div class="input-field">
Change this to
<form class="hide-on-med-and-down">
<div class="input-field right">
Materialize Css Parallax Codepen

Related

How to remove white space between rows when using bootstrap? [duplicate]

This question already has answers here:
How to remove the space between inline/inline-block elements?
(41 answers)
Closed 3 years ago.
I'm creating a product page using bootstrap and was just wondering how to remove the white space between two rows? I've highlighted the space that is causing problems, the page itself isn't finished but I foresee this being an issue I'll run into again and want to deal with it the now and be able to get better practice when I encounter it later.
<body>
<div class="container">
<div class="row justify-content-center" id="header" style="margin-bottom: 0px">
<div class="col-md-3">
<img src="fakelogo.png" alt="Placeholder logo for Golden Shoe" width="100%" height="40%">
</div>
<div class="col-md-6">
<nav class="nav justify-content-center">
<a class="nav-link" href="#">Home</a>
<a class="nav-link" href="#">Products</a>
<a class="nav-link" href="#">My Account</a>
<a class="nav-link" href="#">About</a>
<a class="nav-link" href="#">Contact</a>
</nav>
</div>
<div class="col-md-3">
<img src="shoppingcart.png" alt="Shopping cart icon" width="10%" height="10%">
<p>Your Shopping Cart</p>
<p>Shoes : 0 Cost: 0 </p>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="row">
<div class="col-md-12">
<p>Search By</p>
<form action="">
<div class="form-group">
<label for="keywords">Keywords: </label>
<input type="text" class="form-control" id="keywords">
</div>
<div class="form-group">
<label for="category">Categorys</label>
<select class="form-control" id="category">
<option> -- Select Category --</option>
<option>Men's Sports</option>
<option>Men's Evening Wear</option>
<option>Mens's Casual</option>
<option>Men's Slippers</option>
<option>Men's Sandles</option>
<option>Woman's Sports</option>
<option>Woman's Evening Wear</option>
<option>Woman's Casual</option>
<option>Woman's Slippers</option>
<option>Woman's Sandles</option>
<option>Woman's Highheels</option>
<option>Womans's Pumps</option>
<option>All</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>Categories</p>
<ul>
<li>Men's Sports</li>
<li>Men's Evening Wear</li>
<li>Men's Casual</li>
<li>Men's Slippers</li>
<li>Men's Sandles</li>
<li>Woman's Sports</li>
<li>Woman's Evening Wear</li>
<li>Woman's Casual</li>
<li>Woman's Slippers</li>
<li>Woman's Sandles</li>
<li>Woman's Highheels</li>
<li>Woman's Pumps</li>
<li>All</li>
</ul>
</div>
</div>
</div>
<div class="col-md-9">
<div class="row">
<div class="col-sm-6">
<img id="displayImage" src="DisplayShoe/1.png" alt="Primary shoe display image" style="width: 100%;height: 80%;">
</div>
Issue is you're setting width of the image to 100% and height of the image to 40%.
<div class="col-md-3">
<img src="fakelogo.png" alt="Placeholder logo for Golden Shoe" width="100%" height="40%">
</div>
To avoid this use max-height and max-width(px) with Bootstrap responsive images.
Live demo
As #hbamithkumara mentioned you can use bootstraps img-fluid class.
The example below shows the magic behind the scenes.
In short:
When you set width AND height of an image its very likely to get distorted. When you set only one of them the otherone gets scaled by the images proportions.
Since you want to fill the width of your container you simply set width to 100% thats it :)
Click "Run code snippet" then "Full page"
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row justify-content-center" id="header" style="margin-bottom: 0px">
<div class="col-md-3">
<img src="http://lorempixel.com/300/160/business" alt="Placeholder logo for Golden Shoe" style="width: 100%">
</div>
<div class="col-md-6">
<nav class="nav justify-content-center">
<a class="nav-link" href="#">Home</a>
<a class="nav-link" href="#">Products</a>
<a class="nav-link" href="#">My Account</a>
<a class="nav-link" href="#">About</a>
<a class="nav-link" href="#">Contact</a>
</nav>
</div>
<div class="col-md-3">
<img src="http://lorempixel.com/100/100/business" alt="Shopping cart icon" width="10%">
<p>Your Shopping Cart</p>
<p>Shoes : 0 Cost: 0 </p>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="row">
<div class="col-md-12">
<p>Search By</p>
<form action="">
<div class="form-group">
<label for="keywords">Keywords: </label>
<input type="text" class="form-control" id="keywords">
</div>
<div class="form-group">
<label for="category">Categorys</label>
<select class="form-control" id="category">
<option> -- Select Category --</option>
<option>Men's Sports</option>
<option>Men's Evening Wear</option>
<option>Mens's Casual</option>
<option>Men's Slippers</option>
<option>Men's Sandles</option>
<option>Woman's Sports</option>
<option>Woman's Evening Wear</option>
<option>Woman's Casual</option>
<option>Woman's Slippers</option>
<option>Woman's Sandles</option>
<option>Woman's Highheels</option>
<option>Womans's Pumps</option>
<option>All</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>Categories</p>
<ul>
<li>Men's Sports</li>
<li>Men's Evening Wear</li>
</ul>
</div>
</div>
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-6">
<img id="displayImage" src="http://lorempixel.com/200/400/nature" alt="Primary shoe display image" style="width: 100%;">
</div>
<div class="col-md-6">
<img id="displayImage" src="http://lorempixel.com/300/500/fashion" alt="Primary shoe display image" style="width: 100%;">
</div>
</div>
</div>
</div>
</div>

good way to create margin to the top for the first element

I have list that I render with semantic-ui and it needs some margin to the top for the first element. I looked in the CSS code and I see margin-top:0!important and I can override it for the first element with margin-top:10px!important; and then the rendering looks good. Is there a better way to achieve it? My code (without the fix) is
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<ul class="nav nav-tabs">
<li class="nav active">All
</li>
<li class="nav">Company
</li>
<li class="nav">Private
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane fade in active" id="A">
<div class="ui divided items">
<div class="item">
<div class="ui left floated">
7 July.
<br>3:33
</div>
<div class="image">
<a href="/vi/5022701123010560.html">
<img src="http://lh3.googleusercontent.com/JZkr-b_aWlYrFG1G-EUywZgucJE3JV1wgz4yQGrx-bGaw_va7dymsaTMXhK5t6ZkUdjWLeHlNaiksVNAMp8I1epB-Q=s150" title="Wordpress development company, website developer" alt="Wordpress development company, website developer">
</a>
</div>
<div class="content">
<a class="header" href="/vi/5022701123010560.html">Wordpress development company, website developer</a>
<div class="meta">
<span class="price"></span>
</div>
<div class="description">
<p>Dit Interactive have experts wordpress ...</p>
</div>
<div class="extra">
<div class="ui label">
Services
</div>
<div class="ui label">
For sale
</div>
<div class="ui label">Central NJ</div>
<div class="ui label">New Jersey</div>
<div class="ui right floated primary button">
Buy now
<i class="right chevron icon"></i>
</div>
</div>
</div>
</div>
<div class="item">
<div class="ui left floated">
7 July.
<br>0:54
</div>
<div class="image">
<a href="/vi/5870511561113600.html">
<img src="http://lh3.googleusercontent.com/rsfBseoSy-KPg6P703Dknbpd0t2Ug4n2BY8oKkg2XH5dkufstmZXMWSCsHTU4C0yb7bIaMBpAFxILaW6W3lZsiCt=s150" title="Dentist in Westminster" alt="Dentist in Westminster">
</a>
</div>
<div class="content">
<a class="header" href="/vi/5870511561113600.html">Dentist in Westminster</a>
<div class="meta">
<span class="price"></span>
</div>
<div class="description">
<p>Pari J. Moazed, DDS is a family dentist ...</p>
</div>
<div class="extra">
<div class="ui label">
Services
</div>
<div class="ui label">
For sale
</div>
<div class="ui label">Baltimore</div>
<div class="ui label">Maryland</div>
<div class="ui right floated primary button">
Buy now
<i class="right chevron icon"></i>
</div>
</div>
</div>
</div>
</div>
This "solution" works, but I don't like it
<div {% if loop.index0 == 0 %}style="margin-top:10px!important"{% endif %} class="item">
By the looks of it I would personally just change the margin on the with the simple line:
.container .nav{
margin-top:10px;
}
Does this answer your question? (I know it looks too simple to be true)
I would suggest adding a custom class to <ul class='nav nav-tabs'>
<ul class="nav custom-class nav-tabs">
and adding margin-bottom to it
.custom-class{
margin-bottom:20px;
}
We are adding a custom class to unordered list <ul> so that changes made to it doesn't effect other elements which are using nav class
On your div.tab-content try adding class ui basic segment
I know it is waaay overdue, but I came across this thread when looking for the same issue in Semantic UI React. My solution was to add a divider above the first container:
<Divider hidden></Divider>

How can I simply place a button on the top right of the page?

My main goal is to create a btn that play/pause the song on my wedding site.
I got it to work on the desktop view port, but not on the phone.
Notice the play btn on the far right, when clicking on it, it will play the song, the icon will toggle to pause, like this
So far so good, everything work perfectly fine.
Here come the issue, here what it look like on the 400px
I see it, but, they're not clickable at all.
I tried to inspect it, this is what I see.
I was thinking that I had the issue with z-index, I've tried to give one to my btn, but it still doesn't work.
I'm a little stuck now, please feel free to give me any suggestions.
HTML
<!--Header start -->
<header>
<!--menu start-->
<div class="menu">
<div class="navbar-wrapper" id="navbar">
{{-- Music --}} -------------------------------------------------
<div class="pull-right btn-music">
<a class="pause_audio_btn hidden"><i class="fa fa-pause"></i></a>
<a class="play_audio_btn"><i class="fa fa-play"></i></a>
</div>
{{-- Music --}} -------------------------------------------------
<div class="container">
<!--Logo -->
<div class="logo">
<img id="logo" src="/img/love/logo_pink.png" alt="Roth-Long-Wedding">
</div>
<div class="logo_phone hidden">
<img src="/img/love/logo_pink.png" alt="Roth-Long-Wedding">
</div>
<div class="navwrapper">
<div class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navArea">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav" id="navigation">
<li class="menuItem" id="home">Home</li>
<li class="menuItem">Count Down</li>
<li class="menuItem">Couple</li>
<li class="menuItem">Events</li>
<li class="menuItem">Gallery</li>
<li class="menuItem">Accommodation</li>
<li class="menuItem">RSVP</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- End Navbar -->
</div>
</div>
</div>
<!--menu end-->
<!--video header start-->
<div class="banner row" id="banner">
<div class="col-xs-12 col-sm-6 col-md-12 col-lg-12 noPadd slides-container" style="height:100%">
<!--background slide show start-->
<div class="slide into_firefly">
<!--header text1 start-->
<div class="container hedaer-inner ">
<div class=" bannerText clearfix ">
<h1>Long & Roth</h1>
<h4>WE ARE GETTING MARRIED</h4>
<p class="ruler"><span></span>
<a class="pause_audio_btn hidden"><i class="fa fa-pause"></i></a>
<a class="play_audio_btn"><i class="fa fa-play"></i></a>
<span></span></p>
<h4 class="date long">July 26th, 2016</h4>
<h4 class="date short">-07.26.2016-</h4>
</div>
<p class="downArrow"><i class="fa fa-chevron-down"></i></p>
</div>
<!--header text end-->
<img src="/img/love/main/edit/retina.jpg" alt="Main Image">
</div>
<!--background slide show end-->
</div>
</div>
<!--banner end-->
</header>
<!--Header end -->
Remove the part where you have set the logo to z-index: 9999
Then add this to your css
.navbar-header button{
float:right;
}
It is a z-index issue, but z-index is tricky and only works when the elements have a position other than static (which is default).
{{-- Music --}} -------------------------------------------------
<div class="pull-right btn-music" style="position:relative; z-index:99">
...
</div>
{{-- Music --}} -------------------------------------------------
<div class="container" style="position:relative; z-index:98">
...
</div>
(I put the styling inline for clarity)
There are likely other way to fix this, but this was the quickest.
Pull the button outside of .navbar-wrapper and put it as the first element under .menu
That'll work :)

Responisve ul list . How do I approach this?

here is the fiddle I am working on Demo
How do I make this column completely responsive so that when the screen size becomes less I want all the elements to stay inline rather than stacking below one another.
How to solve this ?
Here is the sample markup
<div id="apologies-list">
<ul id="apologies-list-content">
<li><a tabindex="-1" href="#">
<div class="user-avatar list-padding span12 clearfix" >
<div class="span1">
<input class="case" name="case" type="checkbox" value="">
</div>
<div class="span2">
<img id="list-avatar" src="http://placehold.it/60x60" alt="" />
</div>
<div class="span6">
<span>Apologies initials</span>
<small>January 31, 2009 9:18 am</small>
</div>
<div class="span3 ">
<span class="badge badge-info custom-badge">2</span>
<i class="icon-trash"></i>
</div>
</div>
</a>
</li>
</ul>
</div>
For CSS please check my fiddle.
use css media queries
#media screen and (max-width:400px)
{
#apologies-list-content li div {display:inline-block}
}

Trying to align input field

I'm having some trouble trying to align this input field. Here is the screenshot
http://i255.photobucket.com/albums/hh140/testament1234/input_zps68391b01.png
Here is my HTML -
<div class="four columns search_box">
<form>
<input type="text" placeholder="SEARCH"/>
</form>
</div>
CSS -
.search_box input{
display:block;
vertical-align:middle
}
I have tried adding line-height but that seems incorrect. The height of container is 90px
Here is the Markup for the Header
<div class="container">
<header>
<div class="twelve columns">
<h1 ><a class="logo" href="#" title="My Phone">my | phone</a></h1>
<ul class="menu">
<li>press</li>
<li>downloads</li>
<li class="noborder"><span>stores</span></li>
</ul>
</div>
<!--SEARCH BOX -->
<div class="four columns search_box">
<form>
<input type="text" placeholder="SEARCH"/>
</form>
</div>
</header>
</div>
I presume that your logo is supposed to sit above the menu and the search box.
Given that, I'd suggest having the logo inside a div class="sixteen columns" and then having the menu inside a <div class="twelve columns"> so it fits the grid alongside the <div class="four columns"> on the next row. Like this:
<div class="container">
<header>
<!--LOGO-->
<div class="sixteen columns">
<h1 ><a class="logo" href="#" title="My Phone">my | phone</a></h1>
</div>
<!--NAVIGATION -->
<div class="twelve columns">
<ul class="menu">
<li>press</li>
<li>downloads</li>
<li class="noborder"><span>stores</span></li>
</ul>
</div>
<!--SEARCH BOX -->
<div class="four columns search_box">
<form>
<input type="text" placeholder="SEARCH"/>
</form>
</div>
</header>
</div>
Then it's just CSS tweaks to line up the menu text with the search text.
I've put it into a fiddle here: http://jsfiddle.net/davidpauljunior/YR7Em/