i need assistance trying to build a three column footer in a website with wordpress. I cant seems to get the positioning of the columns right no matter how hard i try. I actually created a child theme to override the original footer that came with the theme. Can somebody help look at my code and kindly profer solutions please
<footer>
<div id="footerwrap">
<div id="menu-footer">
<h3>Links</h3>
<ul>
<li>Our Curriculum</li>
<li>Why Choose us</li>
<li>Apply Online</li>
<li>News</li>
<li>Events/Calendar</li>
</ul>
</div>
<div id="social-footer">
<h3>Links</h3>
<ul>
<li>Our Curriculum</li>
<li>admission procedure</li>
<li>apply online</li>
<li>news</li>
<li>upcoming events</li>
</ul>
</div>
<div id="copyright-footer">
Copyright © <?php echo date('Y'); ?> vidniel Tech
</div>
<div class="clear"></div>
</div>
</footer>
THE CSS
#footerwrap{
width: 100%;
position:relative;
}
#menu-footer{
width:30%;
float:left;
display:inline-block;
margin:0 20px 0 0;
}
.clear {clear:both}
#social-footer{
width:30%;
float: right;
display:block;
margin:0 20px 0 0;
}
#copyright-footer{
width:30%;
float:right;
display:inline;
margin:0 20px 0 0;
}
Banky
Not sure what exactly you're trying to accomplish, but you should be able to overwrite all of your CSS with the below:
#footerwrap{
width: 100%;
position:relative;
}
#menu-footer, #social-footer, #copyright-footer{
width:30%;
margin:0 20px 0 0;
display:inline-block;
vertical-align:top;
}
#media (max-width: 750px){
#menu-footer, #social-footer, #copyright-footer{
width:100%;
margin:0;
}
}
This includes a media query for smaller screens to stack your footer below 750px.
Related
I'm trying to make a slider in a webpage, but overflow:hidden is hidding' everything instead just hide what comes out of the screen.
i need the images to be aligned and everything that comes out of the screen to be hidden.
My fiddle here:
HTML
<div>
<ul>
<li><img src="http://b-i.forbesimg.com/geristengel/files/2013/05/i-ella-fashion-closet.jpg" class="imgs"/></li>
<li><img src="http://cdn.playbuzz.com/cdn/2bff0e00-cbe8-49e5-85d4-7e4c052df449/f097abfe-d3d6-42c5-9768-11616bc985e2.jpg" class="imgs"/></li>
<li><img src="http://www.lakecityphotography.com/design/images/fashion.jpg" class="imgs"/></li>
<li><img src="http://www.thefashionhall.com.br/wp-content/uploads/2012/12/hnjh.jpg" class="imgs"/></li>
</ul>
</div>
CSS:
ul{
list-style:none;
}
li{
position:absolute;
}
.imgs{
height:130px;
width:180px;
float:left;
}
div{
overflow:hidden;
position:relative;
}
Fiddle:
https://jsfiddle.net/mkv9x2fg/2/
Try removing the position absolute from the li
ul {
list-style: none;
white-space:nowrap;
}
li {
display:inline-block;
}
.imgs {
height: 130px;
width: 180px;
}
div {
overflow: hidden;
position: relative;
}
<div>
<ul>
<li>
<img src="http://b-i.forbesimg.com/geristengel/files/2013/05/i-ella-fashion-closet.jpg" class="imgs" />
</li>
<li>
<img src="http://cdn.playbuzz.com/cdn/2bff0e00-cbe8-49e5-85d4-7e4c052df449/f097abfe-d3d6-42c5-9768-11616bc985e2.jpg" class="imgs" />
</li>
<li>
<img src="http://www.lakecityphotography.com/design/images/fashion.jpg" class="imgs" />
</li>
<li>
<img src="http://www.thefashionhall.com.br/wp-content/uploads/2012/12/hnjh.jpg" class="imgs" />
</li>
</ul>
</div>
EDIT: made the li inline-block and set the div to hide the overflow.
It's a little unclear what the OP is trying to do.
Try setting a div width like width: 200px; heigth: auto: max-height: 500px;
I use this method here in the below example.
<!-- vim: set nowrap:-->
<html>
<style type="text/css">
#titleImg{ <!--No use in the code but it makes -->
<!--things to work for some odd reason?!-->
position:absolute; <!--If I remove this, FAILURE --not 2x2.-->
<!--It becomes one-after-another after rem.-->
<!--Why?-->
}
li{
width:190px;
height:190px;
display: block;
float: left;
margin: 5px;
}
</style>
<body>
<center>
<ul style="width:400px; height:400px; text-align:center;">
<li>
<img id="titleImg"
src="../Pictures/Logos/logo.png"
style="width:100%;height:100%">
</li>
<li> </li>
<li> </li>
</ul>
</center>
</body>
You don't I think. Here's an updated jsFiddle example of what I believe you are trying to accomplish. Note: never use <center></center> tags - they are not good practice. Instead set the parent to display: block and its margin to 0 auto.
Here is the new live example
And the code:
HTML
<ul>
<li> <img src="http://www.woodlands-junior.kent.sch.uk/customs/images/uk.jpg"></li>
<li> <img src="http://www.crwflags.com/fotw/images/u/us.gif"> </li>
<li> <img src="http://www.enchantedlearning.com/school/Canada/flagbig.GIF"> </li>
</ul>
CSS
ul {
display: block;
margin: 0 auto;
}
li {
width:190px;
height:190px;
display: block;
float: left;
margin: 5px;
overflow: hidden;
}
I'm having one hell of a headache trying to figure this out for myself, i've taught myself the code i know, so i very well could be missing a simple thing. But i greatly need you're help and appreciate it tremendously.
I obviously want my website to look the same across all browsers and this is a major mess, that i am struggling with.
The problem is easier to explain with pictures, as such i have a screen print from ie9 and ff to show you:
Firefox, Safari, Chrome & IE7
How the footer and lists look in Firefox, Safari, Chrome & IE7
IE9 & IE8 (the grey at the bottom is the body background)
How the footer and lists look in IE9 & IE8
Here is the html:
<div id="footer">
<div id="columncon">
<div class="column">
<h5>From The Blog...</h5>
<ul>
<li><a href="#">Blog Post 1<a/></li>
<li><a href="#">Blog Post 2<a/></li>
<li><a href="#">Blog Post 3<a/></li>
<li><a href="#">Blog Post 4<a/></li>
<li><a href="#">Blog Post 5<a/></li>
</ul>
</div>
<div class="column">
<h5>Social</h5>
<ul>
<li><a href="#">Facebook<a/></li>
<li><a href="#">Twitter<a/></li>
<li><a href="#">Google +<a/></li>
<li><a href="#">RSS Subscribe<a/></li>
<li><a href="#">E-mail Subscribe<a/></li>
</ul>
</div>
<div class="column">
<h5>Site Links</h5>
<ul>
<li><a href="#">Designer Resources<a/></li>
<li><a href="#">Submit a T-Shirt<a/></li>
<li><a href="#">Sitemap<a/></li>
<li><a href="#">Contact Us<a/></li>
</ul>
</div>
<div class="column">
<h5>Site Links</h5>
<ul>
<li><a href="#">Designer Resources<a/></li>
<li><a href="#">Submit a T-Shirt<a/></li>
<li><a href="#">Sitemap<a/></li>
<li><a href="#">Contact Us<a/></li>
</ul>
</div>
</div>
<div id="siteinfo">
<p>© 2011 TShirtSlut.com</p>
</div>
Here is the CSS:
#footer {
background: url(img/footerbg.png) 0 0;
-moz-box-shadow: 0 0px 10px #000;
-webkit-box-shadow: 0 0px 10px #000;
box-shadow: 0 0 10px #000;
height:200px;
position:relative;
clear:both;
}
#columncon {
width:1000px;
margin:0 auto;
}
.column {
float:left;
padding: 30px 25px 20px;
width: 200px;
}
.column ul {
list-style:none;
}
.column ul li {
padding:2px 0;
}
.column ul li a{
text-decoration:none;
color:#fff;
font-size:12px;
}
.column ul li a:hover{
color:#49E20E;
}
.column h5 {
padding-bottom:10px;
border-bottom:1px solid #fff;
color:#fff; text-shadow: black 0.1em 0.1em 0.2em;
font-weight:bold;
font-size:14px;
}
#siteinfo {
text-align:center;
width:100%;
margin:auto;
position:absolute;
bottom:0;
color:#fff;
font-size:12px;
}
#siteinfo a {
text-decoration:none;
color:#fff;
}
#siteinfo a:hover {
color:#49E20E;
text-decoration:none;
}
(apparently I'm not the best at inserting code XD)
Once again i truly will appreciate whoever can put this problem into context for me and allow me to solve this issue.
If you need anymore code, or info please ask and i shall get to it right away.
Thank you,
Mike
UPDATE: I have fixed the anchor tags so they validate but am still left with a double footer and the heading of the first list still remaining in the "doubled" footer. Please follow URL for a picture:
--http://tshirtslut.com/ie%28partially%20fixed%29.jpg--
Your html is not valid. Replace all <a/> with </a>. Is your problem solved now?
I am prototyping a Wordpress template and I'm trying to place the same elements on the header like this: http://dl.dropbox.com/u/768097/about.pdf
Here are the HTML and CSS files: http://acreedy.oliveandpickle.com/
I need 4 columns in the header and everything should be placed under the images.
HTML:
<div id="header">
<h1>Alan Creedy</h1>
<ul id="quickInfo">
<li class="mission">Mission Statement</li>
<li>Helping People Think for Themselves</li>
<li>1.919.926.0688</li>
<li>Email Me</li>
</ul>
<ul id="menu">
<li class="current">Home</li>
<li>About</li>
<li>Best Practice Ideas</li>
<li>Management Tools</li>
<li>Preneed</li>
<li>Case Studies</li>
<li>Recommended Resources</li>
<li>Think Tank Forum</li>
</ul>
</div>
CSS:
#header {
border-bottom:3px solid #1582AB;
height:200px;
margin:0 auto;
padding:46px 0 0;
width:1000px;
position:relative;
}
#header h1 {
background:url("images/alan_creedy_headshot_transparent.png") no-repeat left top;
font-size:40px;
height:140px;
padding:8px 0 0 215px;
margin:0;
}
#quickInfo {
position:absolute;
right:10px;
top:10px;
width:400px;
}
#quickInfo li {
list-style-type:none;
}
.mission {
font-size:18px;
}
#menu {
margin:0 auto;
padding:0;
width:1000px;
}
Floating left will most certainly fix your issue, though keep in mind whenever you add padding or margin to your floated element that you will have to adjust your width as well. I checked out your page and you didn't compensate that change. Fix the width accordingly and you should be good to go :D
~ Chris
http://twitter.com/TheCSSGuru
If you're using html5 then you could use aside or section elements instead of div's.
<style>
.column {
float: left;
width: 200px;}
</style>
<aside class="column">
Column1
</aside>
<section class="column">
Column2
</section>
<section class="column">
Column3
</section>
<section class="column">
Column4
</section>
I have an outer div, and inside of that, I have an inner div which contains a list of images. When the images are wider than the outer div, I want to have it scroll horizontally, but instead, it just puts the image on the next line instead of expanding. If I add many rows, the div does scroll vertically, but horizontally, it doesn't do it. This happens on every browser I've tried - Firefox, Chrome, IE, and Safari.
Here is the css:
#grid-container { left:33px; position:relative; width:300px; }
#grid { width:310px; height:400px; overflow:auto; margin-bottom: 15px; }
#grid-container ul { width:305px; }
#grid-container li { float:left; list-style-type:none; padding:5px 15px 5px 15px; height:88px; text-align:center; }
.image-row { float:left; margin-left: 10px; }
.grid-image { height:50px; margin-left:-20px; }
Here is the html:
<div id="grid-container">
<div id="grid">
<div id="row1" class="image-row">
<ul>
<li>
<img id="img1" class="grid-image" src="images/img1.jpg">
</li>
<li>
<img id="img2" class="grid-image" src="images/img2.jpg">
</li>
<li>
<img id="img3" class="grid-image" src="images/img3.jpg">
</li>
<li>
<img id="img4" class="grid-image" src="images/img4.jpg">
</li>
</ul>
</div>
<div id="row2" class="image-row">
<ul>
<li>
<img id="img5" class="grid-image" src="images/img5.jpg">
</li>
<li>
<img id="img6" class="grid-image" src="images/img6.jpg">
</li>
</ul>
</div>
</div>
</div>
The problem is img4 is showing on the second row (with img5 and img5 on the third row), even though it should on the first row and the grid div should scroll horizontally. It does scroll vertically. Can I force the div to expand? If I remove the width from the grid div, I do get the horizontal scroll bar, but the image is still on the second row.
Will this do? I simplified it somewhat.
CSS (you can remove the borders, they are just so you can see what is happening):
#grid-container {position: relative; width: 300px; height: 400px; overflow: auto; border: 1px red solid;}
#grid {border: 1px blue solid;}
#grid ul {height: 40px; list-style-type: none; white-space: nowrap; padding: 0; margin: 0; border: 1px green solid;}
#grid ul li {display: inline; padding: 0; margin: 0;}
#grid ul li img {height: 50px;}
HTML:
<div id="grid-container">
<div id="grid">
<ul>
<li><img src="testimage.jpg"></li>
<li><img src="testimage.jpg"></li>
<li><img src="testimage.jpg"></li>
<li><img src="testimage.jpg"></li>
<li><img src="testimage.jpg"></li>
<li><img src="testimage.jpg"></li>
</ul>
<ul>
<li><img src="testimage.jpg"></li>
<li><img src="testimage.jpg"></li>
<li><img src="testimage.jpg"></li>
</ul>
</div>
</div>
You need to put a white-space:nowrap; on the UL and LI tags. You also need the LI elements to be display inline rather than floating them.
CSS:
#grid-container { left:33px; position:relative; width:300px; }
#grid { width:310px; height:400px; overflow:auto; margin-bottom: 15px; }
#grid-container ul { width:305px; }
#grid-container li {
display:inline;
list-style-type:none;
padding:5px 15px 5px 15px;
height:88px;
margin:0;
text-align:center;
}
ul, li{
white-space:nowrap;
}
HTML:
<div id="grid-container">
<div id="grid">
<div class="image-row">
<ul>
<li>
<img id="img1" class="grid-image" src="test.jpg" />
</li>
<li>
<img id="img2" class="grid-image" src="test.jpg" />
</li>
<li>
<img id="img3" class="grid-image" src="test.jpg" />
</li>
<li>
<img id="img4" class="grid-image" src="test.jpg" />
</li>
</ul>
</div>
<div class="image-row">
<ul>
<li>
<img id="img5" class="grid-image" src="test.jpg" />
</li>
<li>
<img id="img6" class="grid-image" src="test.jpg" />
</li>
</ul>
</div>
This works in latest versions of IE, FF, Safari and Chrome.
try this:
#grid-container li {
display: inline;
list-style-type:none;
padding:5px 15px 5px 15px;
height:88px;
text-align:center;
white-space: nowrap;
}
You're already on the right path: Your approach to set "float: left;" on the <li>s, in combination with setting "width: 305px" on the <ul>s should basically work to avoid float dropping.
However, a few things to check:
Are 305px really enough? (It must be at least as large as the combined width of the elements in row 1, including margins, paddings and borders) Try setting it to a much larger value. overflow: auto won't help, since the floats will always wrap instead of causing an overflow. Setting a large enough width works perfectly for me (at least in my own example).
Other things to try:
Try it without floating ".image-row".
Try setting a width on the images.
You have the id "row1" twice in your HTML - that's invalid.