right floated div...align to bottom? - html

I've got html like so:
<div class="content-wrapper">
<div class="float-left">
<img alt="Track System" src="Images/myimage.png" />
</div>
<div class="float-right">
<nav>
<ul id="menu">
<li class="tab"><a runat="server" href="~/">Home</a></li>
<li class="tab"><a runat="server" href="11Models2.aspx">Models</a></li>
<li class="tab"><a runat="server" href="Lease.aspx">Lease </a></li>
<li class="tab"><a runat="server" href="Help.aspx">Help</a></li>
</ul>
</nav>
</div>
</div>
The first div (The one float-left) is just an image that has some length to it...
The second div (the float-right) are tabs that I want to align on the bottom. Right now they are too high up...
the css classes simply are:
.float-left{
float:left;
}
.float-right{
float:right;
}
I tried changing to absolute and relative positioning but it did not help...
Here's what it looks like with the logo correctly being displayed on the left but the tabs on the right floating...I'd like to get those aligned to the bottom.

Is this what you want? http://jsfiddle.net/86Pr2/4/
I added a div with a class of "clear" and the following CSS: (I added !important to all of them cause I didn't feel like looking through all your code.)
.float-right {
position:absolute !important;
bottom:0 !important;
right:0 !important;
}
.content-wrapper {
position:Relative !important;
}
.clear {
clear:both !important;
}
And the changed HTML:
<div class="content-wrapper">
<div class="float-left">
<img alt="Track System" src="http://i.imgur.com/2M3DyCv.png" />
</div>
<div class="float-right">
<nav>
<ul id="menu">
<li class="tab"><a runat="server" href="~/">Home</a></li>
<li class="tab"><a runat="server" href="11Models2.aspx">Models</a></li>
<li class="tab"><a runat="server" href="Lease.aspx">Lease </a></li>
<li class="tab"><a runat="server" href="Help.aspx">Help</a></li>
</ul>
</nav>
</div>
<div class="clear"><!--This makes the wrapper have a height--></div>
</div>
<div id="body">
<section class="content-wrapper main-content clear-fix">
hi
</section>
</div>

Not that #codedude didn't create something that would work but you wouldn't ever want to use the !important tag in your CSS.
Here's what I was working on: http://jsfiddle.net/dancameron/86Pr2/7/
It doesn't require any additional markup either (an empty div to clear!) and cleans up the class names to be more semantic.
HTML:
<div class="content-wrapper clear-fix">
<div class="float-left">
<img alt="Track System" src="http://i.imgur.com/2M3DyCv.png" />
</div>
<div class="nav-wrap">
<nav>
<ul id="menu">
<li class="tab"><a runat="server" href="~/">Home</a></li>
<li class="tab"><a runat="server" href="11Models2.aspx">Models</a></li>
<li class="tab"><a runat="server" href="Lease.aspx">Lease </a></li>
<li class="tab"><a runat="server" href="Help.aspx">Help</a></li>
</ul>
</nav>
</div>
</div>
<div id="body">
<section class="content-wrapper main-content clear-fix">
hi
</section>
</div>
CSS:
.content-wrapper {
margin: 0 auto;
max-width: 100%;
position: relative;
}
.nav-wrap nav {
position: absolute;
bottom: 5px;
right: 5px;
}

Related

Unnecesary height of html page

my html page has this unwanted white patch in the bottom and I don't know why. I don't want to be able to scroll down that long. It stays there regardless by default. it dissapears when I hover on the left(front) element but reappears when I hover on the right(behind) element.
here is the codepen : https://codepen.io/aronnora/pen/ExjJrag
<nav class="nav_bar">
<img src="580b57fcd9996e24bc43c4f8.png" alt="logo" class="logo" id="logo">
<div class="trans" id="trans"> trans energy solutions </div>
<ul class="ul">
<li class="li1">Home</li>
<li class="li2">About Us</li>
<li class="li3">Products</li>
<li class="li4">Services</li>
<li class="li5">Facility</li>
<li class="li6">Testing</li>
<li class="li7">Clients</li>
<li class="li8">Contact</li>
</ul>
</nav>
<div class="white">
</div>
<div class="pro">
<div class="text">
PRODUCTS
</div>
</div>
<div class="total">
<div class="one">
<img src="liquid-immersed-distribution-transformers-768x784.png" alt="kakashi" class="Kakashi" height="300rem"></img>
<div class="downtextone">
時メユ郎護ヲテ写藤くクッル起稲ロチ製資ヌ米更ナ池天ワア由時テ栃94探容ケニ災逮はぴ氷可難智む。能ざラくな静盟ごぼじ不注更ルモト点究サトケ別意マワ抜博写ミ元
</div>
</div>
<div class="two">
<img src="transtech-2.png" alt="madara" class="Madara" height="300rem"></img>
<div class="downtexttwo">
時メユ郎護ヲテ写藤くクッル起稲ロチ製資ヌ米更ナ池天ワア由時テ栃94探容ケニ災逮はぴ氷可難智む。能ざラくな静盟ごぼじ不
</div>
</div>
</div>
your div takes a default height as it's content. so just add overflow:hidden; to class (.tow)
.two {
height: 58.29rem;
width: 45rem;
transition: opacity 1s;
background-color: black;
position: absolute;
z-index: 10;
overflow: hidden;
}

Phantom top margin on float left

I'm having a little trouble with floating my elements. I have some phantom margin that has appeared on my 3rd col element; as seen in the image below;
I have tried adding; box-sizing: border-box; but this doesn't help either. Is there something I am missing?
Code
#f-wrap {
position: relative;
width:100%;
margin: 0 auto;
}
.row {
display: inline-block;
width: 100%;
}
.col {
display: inline-block;
float: left;
width: 45%;
margin: 2em 1em;
background: #f0f;
}
<section class="ctre s-f">
<div id="t-wrap">
<div class="row">
<div class="col">
<img src="img-bin/mgi-logo.png" alt="MGI Technology logo." width="20%"/>
</div>
<div class="col">
<h3 class="f-h">Related Links</h3><br/>
<ul>
<li class="f-lnk">Home</li>
<li class="f-lnk">About us</li>
<li class="f-lnk">Products</li>
<li class="f-lnk">News</li>
<li class="f-lnk">Contact us</li>
<li class="f-lnk">Recycle</li>
<li class="f-lnk">Site map</li>
</ul>
</div>
</div>
<hr class="style-two"/>
<div class="row">
<div class="col">
<h3 class="f-h">Social</h3><br/>
<ul>
<li class="f-ico"><img src="img-bin/mgi-logo.png" alt="" width="100%" /></li>
<li class="f-ico"><img src="img-bin/mgi-logo.png" alt="" width="100%" /></li>
<li class="f-ico"><img src="img-bin/mgi-logo.png" alt="" width="100%" /></li>
</ul>
</div>
<div class="col f-txt">
<h3 class="f-h">Find Us</h3><br/>
MGI Technology<br/>
<br/>
MAP
</div>
</div>
</div>
</section>
Any assistance I can get with this would be greatly appreciated...
Update: Have now tried vertical-align:top; and removed float:left. Issue persists.
Temporary Live Example
your snippet is not showing any issue but anyhow, but it seems that's due to by default inline-block is vertical-align:baseline, so you must set to vertical-align:top
plus remove unnecessary float:left
#f-wrap {
position: relative;
width:100%;
margin: 0 auto;
}
.row {
display: inline-block;
vertical-align:top;
width: 100%;
}
.col {
display: inline-block;
vertical-align:top;
width: 45%;
margin: 2em 1em;
background: #f0f;
}
<section class="ctre s-f">
<div id="t-wrap">
<div class="row">
<div class="col">
<img src="img-bin/mgi-logo.png" alt="MGI Technology logo." width="20%"/>
</div>
<div class="col">
<h3 class="f-h">Related Links</h3><br/>
<ul>
<li class="f-lnk">Home</li>
<li class="f-lnk">About us</li>
<li class="f-lnk">Products</li>
<li class="f-lnk">News</li>
<li class="f-lnk">Contact us</li>
<li class="f-lnk">Recycle</li>
<li class="f-lnk">Site map</li>
</ul>
</div>
</div>
<hr class="style-two"/>
<div class="row">
<div class="col">
<h3 class="f-h">Social</h3><br/>
<ul>
<li class="f-ico"><img src="img-bin/mgi-logo.png" alt="" width="100%" /></li>
<li class="f-ico"><img src="img-bin/mgi-logo.png" alt="" width="100%" /></li>
<li class="f-ico"><img src="img-bin/mgi-logo.png" alt="" width="100%" /></li>
</ul>
</div>
<div class="col f-txt">
<h3 class="f-h">Find Us</h3><br/>
MGI Technology<br/>
<br/>
MAP
</div>
</div>
</div>
</section>
UPDATE:
Looking at your live site, the issue is that the other col has another class f-txt which has a property font-size:8pt and with that, change the height of the column.
So either you apply the same class to the first .col or remove that property

Overriding Bootstrap Container Full Width Background Color

I'm trying to have my container divs background color extend to the full width of the browser. Right now I am unable to bypass the container styling set up by default in bootstrap, despite adding my own class to the container. The only styling that works is the background-color. I have also tried the following CSS, but it didn't make any change.
margin-right: auto;
margin-left: auto;
padding-left: 0px;
padding-right: 0px;
background-color: #FDDC00;
Here is my HTML:
<div class="container selection-section">
<div class="row pattern-choice">
<div class="col-md-12">
<h2><i>Choose a pattern</i></h2>
<ul>
<li class="button-border">
<h3 class="button-choice" >SOLID</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="stripe-choice">STRIPE</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="plaid-choice">PLAID</h3>
</li>
</ul>
</div>
</div>
</div>
Here is my CSS:
.selection-section {
margin-right: auto;
margin-left: auto;
padding-left: 0px;
padding-right: 0px;
background-color: #FDDC00;
}
Use container-fluid instead of container if you want the container to extend to the full-width of your webpage.
If it's only the color that's a concern surrounding the container with another div might work for you.
.selection-section {
background: #FDDC00;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="selection-section">
<div class="container">
<div class="row pattern-choice">
<div class="col-md-12">
<h2><i>Choose a pattern</i></h2>
<ul>
<li class="button-border">
<h3 class="button-choice">SOLID</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="stripe-choice">STRIPE</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="plaid-choice">PLAID</h3>
</li>
</ul>
</div>
</div>
</div>
</div>
<hr>
<div class="container">
<div class="well">Outside Div</div>
</div>

ng-repeat horizontal images

I am trying to make a list of images horizontal. They keep displaying vertical. Any idea what I am doing wrong?
<div ng-repeat="i in product.images">
<ul id="navlist">
<li>
<img class="thumbnail" ng-src="{{i.image}}"> </img>
</li>
</ul>
</div>
#navlist li
{
display: inline;
list-style-type: none;
padding-right: 20px;
}
You need to put the 'ng-repeat' in the li tag (not the div), otherwise you are repeating the entire div, which is not inline. Here's a link to a CodePen with this code http://codepen.io/jwncoexists/pen/XbdOVY
<body ng-app="ImageDemo">
<div ng-controller="Demo.controller">
<div>
<ul id="navlist">
<li ng-repeat="i in product.images">
<img class="thumbnail" ng-src="{{i.image}}">
</li>
</ul>
</div>
</div>
</body>
calthoff, if you remove the ul, li and float the images..then how about this for simplicity's sake:
<div ng-repeat="i in product.images">
<img class="thumbnail" ng-src="{{i.image}}">
</div>
img
{
float: left;
padding-right: 20px;
}
<div ng-repeat="i in product.images">
<ul id="navlist">
<li>
<img class="thumbnail" ng-src="{{i.image}}" />
</li>
<li>
<img class="thumbnail" ng-src="{{i.image}}" />
</li>
</ul>
</div>
< img > tags are self-closing, your code should work like this.

CSS Header Image (Resizing Issue)

I'm stuck with the CSS of following HTML link and want to expand the height of header image so I can adjust larger with it, but when I play with the CSS of the .header & .logo classes it expands the navigation bar also, I just really need to expand the height of the header image to have larger height logo into it.
Looking your html source seems you can have different solutions. Problem is with your html... You have
<div class="navigation">
inside
<div class="container">
Ans : get navigation div out of container div. Then changing the height of container div would be the best and not affect the height of your links.
Why you are getting problem : your header div is containing links inside it. That is why changing the height of header is not good (It simply changes the overall height of this div).
Update : Reply to your first comment on my answer
<div class="inner">
<div class="container">
<!-- Logo Start -->
<div class="five columns left">
<img src="images/logo.png" alt="" />
</div>
<!-- Logo End -->
<div class="eleven columns right">
<!-- Top Links Start -->
<ul class="top-links">
<li>
<h4 class="colr">Search Music</h4>
<div id="search-box">
<input name="" value="Enter any keyword"
onfocus="if(this.value=='Enter any keyword') {this.value='';}"
onblur="if(this.value=='') {this.value='Enter any keyword';}" type="text" class="bar" />
<button>Search</button>
</div>
</li>
<li>
LOG IN
<div id="login-box">
<h4 class="white backcolr">User Login </h4>
<ul>
<li>
<input name="" value="yourname#email.com"
onfocus="if(this.value=='yourname#email.com') {this.value='';}"
onblur="if(this.value=='') {this.value='yourname#email.com';}" type="text" class="bar" />
</li>
<li>
<input name="" value="password"
onfocus="if(this.value=='password') {this.value='';}"
onblur="if(this.value=='') {this.value='password';}" type="password" class="bar" />
</li>
<li>
<input type="checkbox" class="left" />
<p>Remember me</p>
Forget Password?
</li>
<li>
<button class="backcolrhover">Login</button>
</li>
</ul>
<div class="clear"></div>
</div>
</li>
</ul>
<!-- Top Links End -->
</div>
<div class="clear"></div>
</div>
<!-- Container End -->
<!-- Navigation Start -->
<div class="navigation">
<div id="smoothmenu1" class="ddsmoothmenu">
<ul id="nav">
<li class="current-menu-item">Home</li>
<li>NEWS</li>
<li>Albums
<ul>
<li>Albums</li>
<li>Album Detail</li>
</ul>
</li>
<li>Blog
<ul>
<li>Blog</li>
<li>Blog Detail</li>
</ul>
</li>
<li>Gallery
<ul>
<li>Gallery - Two Column</li>
<li>Gallery - Three Column</li>
<li>Gallery - Four Column</li>
<li>Gallery - Slide Show</li>
</ul>
</li>
<li>About Us</li>
<li>Contact Us</li>
<li>BUY THIS THEME</li>
</ul>
<div class="clear"></div>
</div>
</div>
<!-- Navigation End -->
</div>
Then change your css and see the results
.container {
width:100%;
height:100px; /* I have changed it 50px to 100px*/
float:left;
margin-top:2px;
}
Change your header height here :
#header {
width:100%;
height:148px; <-----------Here
float:left;
position:relative;
z-index:2;
margin-bottom:15px;
box-shadow:0px 2px 2px #000;
background:url(../images/header.gif) repeat-x;
}
Edit: I just inspected with firebug, you are using multiple classes and you've nested div's, your logo div lies here
five columns left
I guess you've picked this template and you are trying to edit it right?