I apologize if this kind of question has been asked and answered. I tried doing a search online before asking, but have yet to find an answer that solves my situation.
I am in the process of developing a website where there's a list (using <li>) on the right of a video and if a user clicks on another item in the list, a new video will play in place of the previous video, if that makes sense.
I prefer to keep my code as clean as possible. pure HTML5 and CSSS is preferred if that's at all possible. Some jQuery is okay if there's no other way to accomplish this.
Hopefully this screenshot will help make sense of what I am trying to accomplish. Iit's not a problem to load a video - the problem is how to make other videos appear in its place when you click on its list item.
edit: adding html and css codes:
<div class="slider_wrapper">
<iframe class="slider_video" width="650" height="366" src="https://www.youtube.com/embed/w8jAm13M9Ec?autoplay=1" frameborder="0"></iframe>
<!-- start slider menu -->
<div class="slider_menu_container">
<div class="slider_menu">
<ul>
<li>Welcome to WSD</li>
<li>WSD: The B.E.S.T.</li>
<li>WSD: A Bilingual Approach</li>
<li>What's Up, WSD?</li>
<li>Headline</li>
<li>Headline</li>
<li>Headline</li>
<li>Headline</li>
</ul>
</div>
</div>
</div>
.slider_wrapper {
position: relative;
top: 0;
left: 0;
width: 934px;
background-color: #d3d3d3;
border: 1px solid #fff;
margin: 0 auto;
}
.slider_video {
margin: 10px 0 10px 10px;
padding: 0;
border: 10px solid #000;
}
.slider_menu_container {
margin: 0 auto;
margin-left: 10px;
margin-right: 10px;
width: 230px;
float: right;
}
.slider_menu {
position: relative;
margin: 0 auto;
margin-top: 10px;
margin-bottom: 5px;
}
.slider_menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.slider_menu li, .slider_menu li.first {
padding: 8px;
height: 24px;
border: 1px solid #fff;
margin-bottom: 7px;
overflow: hidden;
background-color: #207F3E;
box-shadow: 0 0 1px #303030;
}
.slider_menu li:hover, .slider_menu li.first:hover {
background: -moz-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(255,255,255,1) 100%);/* FF3.6-15 */
background: -webkit-linear-gradient(left, rgba(0,0,0,0) 0%,rgba(255,255,255,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to right, rgba(0,0,0,0) 0%,rgba(255,255,255,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00299a0b', endColorstr='#9dbaa6',GradientType=1 ); /* IE6-9 */
box-shadow: 0 0 1px #303030;
}
.slider_menu a {
text-decoration: none;
font-family: 'avenir-medium', Fallback, sans-serif;
font-weight: normal;
font-size: .9em;
color: #fff;
line-height: 24px;
vertical-align: middle;
}
.slider_menu a:hover {
color: #303030;
}
This can't be done with CSS alone, no, you will need some JavaScript.
<li onclick="return play('w8jAm13M9Ec')">Welcome to WSD</li>
function play(clip) {
var video = document.getElementsByTagName('iframe')[0];
video.src = 'https://www.youtube.com/embed/'+clip+'?autoplay=1';
return false;
}
See this fiddle.
(Using a jsfiddle instead of a snippet, because the snippet sandbox treats YouTube videos as insecure.)
Related
I have uploaded a web page
The problem is that when I resize the window of browser, the content overlaps with each other. I saw multiple posts related to the topic online, but was not able to find a reasonable answer. I have tried position relative and everything I knew of. If you know, anything about how to solve this issue, please tell me.
CSS:
#import url(http://fonts.googleapis.com/css?family=Lato:300,400,700);
#charset 'UTF-8';
h1, h2, h3, h4, h5, h6, p, a, ul, ol, li, small
{
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
background: transparent;
}
#intro
{
position:relative;
width:100%;
height:30%;
background: #566074;
min-width:50%;
min-height:20%;
}
#nav
{
position:relative;
width: 100%;
height: 7%;
}
#buffer
{
position:relative;
width:100%;
height:1%;
}
/* Base Styles */
#nav ul,
#nav li,
#nav a {
list-style: none;
margin: 0;
padding: 0;
border: 0;
line-height: 1;
font-family: 'Lato', sans-serif;
}
#nav {
border: 1px solid #133e40;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
width: auto;
}
#nav ul {
zoom: 1;
background: #36b0b6;
background: -moz-linear-gradient(top, #36b0b6 0%, #2a8a8f 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #36b0b6), color-stop(100%, #2a8a8f));
background: -webkit-linear-gradient(top, #36b0b6 0%, #2a8a8f 100%);
background: -o-linear-gradient(top, #36b0b6 0%, #2a8a8f 100%);
background: -ms-linear-gradient(top, #36b0b6 0%, #2a8a8f 100%);
background: linear-gradient(top, #36b0b6 0%, #2a8a8f 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#top-color', endColorstr='#bottom-color', GradientType=0);
padding: 5px 10px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
#nav ul:before {
content: '';
display: block;
}
#nav ul:after {
content: '';
display: table;
clear: both;
}
#nav li {
float: left;
margin: 0 5px 0 0;
border: 1px solid transparent;
}
#nav li a {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
padding: 8px 15px 9px 15px;
display: block;
text-decoration: none;
color: #ffffff;
border: 1px solid transparent;
font-size: 16px;
}
#nav li.active a {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
display: block;
background: #1e6468;
border: 1px solid #133e40;
-moz-box-shadow: inset 0 5px 10px #133e40;
-webkit-box-shadow: inset 0 5px 10px #133e40;
box-shadow: inset 0 5px 10px #133e40;
}
#nav li:hover {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
border: 1px solid #36b0b6;
}
#nav li:hover a {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
display: block;
background: #1e6468;
border: 1px solid #133e40;
-moz-box-shadow: inset 0 5px 10px #133e40;
-webkit-box-shadow: inset 0 5px 10px #133e40;
box-shadow: inset 0 5px 10px #133e40;
}
img
{
height:100%;
position:relative;
width:15%;
padding-right:2%;
float:left;
}
#intro p
{
color: white;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size:150%;
padding-top:2%;
font-weight:bolder;
}
#buffer1
{
width:100%;
height:1%;
position:relative;
}
#content {
position : absolute;
width : 99%;
height : 60%;
background-color : #566074;
text-align: center;
}
#content:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
HTML
<html>
<head>
<title>
HomePage
</title>
<link rel="stylesheet" href="mystyle.css">
</head>
<body>
<div id= 'intro'>
<img src="pics/Sushil_Parti.jpg" alt="Sushil Parti">
<p>
Sushil Parti <br>
Graduate Student <br>
Dept. of Computer Science <br>
University of Windsor
</p>
</div>
<div id='buffer'></div>
<div id='nav'>
<ul>
<li class='active'> <a href='#'><span>About</span></a></li>
<li> <a href='academics.html'><span>Courses</span></a></li>
<li> <a href='research.html'><span>Research</span></a></li>
<li> <a href='work.html'><span>Work Experience</span></a></li>
<li> <a href='activities.html'><span>Activities</span></a></li>
<li class='last'><a href='contact.html'><span>Contact Me</span></a></li>
</ul>
</div>
<div id='buffer1'></div>
<div id ='content'>
<div id='info'>
<p>
Hi, I am a first year MSc student in Computer Science at
University of Windsor. </br>
I am currently working under the supervision of Prof. Dan Wu. My research interests
include Computer Vision, Robotics, Machine Learning and AI.
<br> <br>
I have completed my bachelors degree (B.Tech) in Computer Science with specialization in Software Engineering from Lovely Professional University
in 2011.<br><br>
Curriculum Vitae [PDF]
</p>
</div>
</div>
</body>
</html>
Image of webpage after window is resized.
![enter image description here][1
This is doing what you told it to do. You have min-height of #intro set to 20%. If you make the browser too small, then that 20% is not tall enough to show all of your text.
Try setting the min-height to be 150px. That seems to be enough to keep your text from being clipped. Then it will still grow if you make the window taller.
I am facing a small problem in time to align my divs inside a <li>. I would like to vertically align my div (which has a picture inside), in a way that no matter the height of my <li>, it will always be in the middle. NO USE WITH MARGIN-TOP PERCENTAGE (%). Already used the display table but did not work for my case.
Here the picture of how I would like to stay:
How is increased when the height of my <li>.
The image is not in the middle of <li>. ^
If anyone can help me, this here my file fiddle. Remember without using margin :). In my case I am temporarily using the file fiddle.
http://jsfiddle.net/Igaojsfiddle/T6KrE/37/
#frdImgProfile {
width: 50px;
height: 50px;
border: 1px solid #aaa;
background: #ffe;
position:absolute;
margin-top:3px;
margin-left:4px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
}
Thank you!
Well... We'll go for parts:
First: You don't have to abuse with the id attributes.
Second: In your CSS code, you have a lot of rules that reference to same id. This is not a good practice. It supposed that the id is unique.
Third: I've seen that you have a div called: div#avatarUser. I guess that you created this for setting special style. Well you don't need to do this. With parent:first-child or parent:nth-child(1) you can set specific styles for the first element:
E.g.:
<ul>
<li></li> <!-- I want to set specific styles for this element. The first element -->
<li></li>
<li></li>
</ul>
So, for do that just in my CSS file, I'll put:
ul > li:nth-child(1) { /* Your CSS code */ }
Well, now we deep in your problem.
I changed a little your HTML code, because I think it's more organized and clean code:
<div class="frdList">
<ul class="contactList">
<li>Friends :)</li>
<li class="p-flexbox flex-hsc">
<img src="http://w2.vanillicon.com/2c85954e3b080d9926c53b530ca40317_50.png" />
</li>
<li class="p-flexbox flex-hsc">
<img src="http://w6.vanillicon.com/6cd18e7a56ebd6fb1f3f607823b7d5fe_50.png" />
</li>
<li class="p-flexbox flex-hsc">
<img src="http://wc.vanillicon.com/cd7c7d1f9a0c56ff3b8296527a98564f_50.png" />
</li>
<li class="p-flexbox flex-hsc">
<img src="http://vanillicon.com/0fff488a9952086c6785f260e2c127ad_50.png" />
</li>
</ul>
</div>
And also changed the CSS file:
/* Reset CSS */
body, div {
margin: 0;
padding: 0;
}
li { list-style: none; }
/* #font-faces imports */
#font-face {
font-family:'Amatic SC';
font-style: normal;
font-weight: 400;
src: local('Amatic SC Regular'), local('AmaticSC-Regular'), url(http://themes.googleusercontent.com/static/fonts/amaticsc/v3/DPPfSFKxRTXvae2bKDzp5D8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}
/* Basic styles */
.frdList {
height:500px;
width:500px;
}
.contactList > li:nth-child(1) {
font-weight: bold;
font-family: 'Amatic SC', cursive;
font-size: 45px;
text-align: center;
color: #fff;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
background-image: -webkit-linear-gradient(#2da1ec, #0191d9);
background-image: -moz-linear-gradient(#2da1ec, #0191d9);
background-image: -ms-linear-gradient(#2da1ec, #0191d9);
background-image: linear-gradient(#2da1ec, #0191d9);
border: 1px solid #0082c3;
border-bottom: 1px solid #077be0;
position: relative;
height:55px;
}
.contactList > li:nth-child(1):hover {
background-image: -webkit-linear-gradient(#2eacff, #0191d9);
background-image: -moz-linear-gradient(#2eacff, #0191d9);
background-image: -ms-linear-gradient(#2eacff, #0191d9);
background-image: linear-gradient(#2eacff, #0191d9);
}
.contactList > li:nth-child(1):after {
content: url("http://images1.wikia.nocookie.net/knd/images/3/3a/PR2.gif");
text-align: center;
width: 68px;
height: 65px;
background: #8dfd07;
display: inline-block;
position: absolute;
top: -10px;
left: 15px;
border-radius: 5px;
border: solid 1px #aaa;
}
.contactList > li:nth-child(1):before {
content: "";
position: absolute;
border-radius: 6px;
width: 78px;
height: 75px;
background-color: white;
line-height: 70px;
/* Well see */
text-align: center;
border: solid 1px #aaa;
top: -15px;
left: 10px;
}
.contactList > li {
font-weight: bold;
color: #fff;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 2px -2px gray;
background-image: -webkit-linear-gradient(#ededed, #eff0f2);
background-image: -moz-linear-gradient(#ededed, #eff0f2);
background-image: -ms-linear-gradient(#ededed, #eff0f2);
background-image: linear-gradient(#ededed, #eff0f2);
border-left: 10px solid green;
border-right: 1px solid #999999;
height:120px;
}
.p-flexbox {
/* Flexbox: Init setup */
display: -webkit-box;
display: -moz-box;
display: box;
}
.flex-hsc {
/* Flexbox: Principal setup */
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
box-orient: horizontal;
-webkit-box-pack: start;
-moz-box-pack: start;
box-pack: start;
-webkit-box-align: center;
-moz-box-align: center;
box-align: center;
}
To center the images I used Flexible Box Model or Flexbox.
But I think... Why to complicate? If you know the height of the container of the image, use line-height
In the development area exists a principle called KIS. It means:
Keep It Simple.
If you have the solution (and a good solution), use it! This will avoid headaches.
Here's a DEMO.
Try to change the height of the li elements in the demo and you will see that the images will always be center.
Cheers,
Leonardo
If you won't use margin, try with line-height on li and .frdImgProfile
Change #frdImgProfile to .frdImgProfile and on your html change id=frdImgProfile to class=frdImgProfile,
Remove margin-top on .frdImgProfile
Add line-height: 120px; to #contactList > li
Add display: inline-block; vertical-align: middle;line-height: normal; to .frdImgProfile
#contactList > li {
font-weight: bold;
color: #fff;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 2px -2px gray;
background-image: -webkit-linear-gradient(#ededed, #eff0f2);
background-image: -moz-linear-gradient(#ededed, #eff0f2);
background-image: -ms-linear-gradient(#ededed, #eff0f2);
background-image: linear-gradient(#ededed, #eff0f2);
border-left:10px solid green;
border-right:1px solid #999999;
height:120px;
line-height: 120px;
}
.frdImgProfile {
width: 50px;
height: 50px;
border: 1px solid #aaa;
background: #ffe;
margin-left:4px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
display: inline-block;
vertical-align: middle;
line-height: normal;
}
demo on cssdeck
Hope this help
can add .. add you complete classes. ++
#contactList > li {
position:relative;
}
#frdImgProfile {
width: 50px;
height: 50px;
position:absolute;
margin-top:-25px;
top:50%;
}
I'm running into a problem.
I know this is probably a noob mistake but bear with me.
I'm making two top bar menus at the top, I can place them using absolute positioning and top, however when the browser size changes it makes the top bar look messed up.
Is there a way to place these without using absolute position and top?
This is what I currently have:
THE HTML
<div id="nav">
<div class="logo"><h1>Health Numeric ©</h1>Live a Something Life</div>
<div style="display:inline-block">
<ul>
<li><img class="icons" src="img/icons/dashboard.png" />Dashboard</li>
<li><img class="icons" src="img/icons/patient.png" />Patients</li>
<li><img class="icons" src="img/icons/devices.png" />Devices</li>
<li><img class="icons" src="img/icons/account.png" />Account</li>
<li><img class="icons" src="img/icons/support.png" />Support</li>
</ul>
</div>
<div class="end"><strong>LifeView</strong> Portal</div>
</div>
<div id="subnav">
<span class="clientname">Patient: Brian Town</span>
</div>
<div id="bod">
<h1> test</h1>
</div>
The CSS
#nav h1 {
font: Verdana, Geneva, sans-serif;
font-size: 24px;
margin-bottom: 2px;
}
.logo {
width: 190px;
margin: auto 80px auto 50px;
display: inline-block;
vertical-align: top;
}
#nav {
position: fixed;
/*height: 65px;*/
width: 100%;
float: left;
left: 0px;
top: 0px;
margin: 0px;
padding: 0px;
color: #FFFFFF;
/* IE10 Consumer Preview */
background-image: -ms-linear-gradient(top, #0389FF 0%, #000000 100%);
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top, #0389FF 0%, #000000 100%);
/* Opera */
background-image: -o-linear-gradient(top, #0389FF 0%, #000000 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #0389FF), color-stop(1, #000000));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top, #0389FF 0%, #000000 100%);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to bottom, #0389FF 0%, #000000 100%);
}
#nav ul {
list-style: none;
width: 450px;
margin: 0 auto;
padding: 0;
}
#nav li {
float: left;
}
#nav li a {
display: inline-block;
padding: 8px 15px;
text-decoration: none;
font-weight: bold;
color: #FFF;
border-right: 1px solid #ccc;
}
#nav li:first-child a {
border-left: 1px solid #ccc;
}
#nav li a:hover {
color: #23afff;
}
.end {
width: 200px;
margin: 10px auto auto 50px;
display: inline-block;
word-spacing: 20px;
vertical-align: top;
}
strong {
font: Verdana, Geneva, sans-serif;
font-size: 36px;
margin-bottom: 2px;
}
.icons {
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 1px;
height: 35px;
width: 35px;
}
#subnav {
position: fixed;
overflow:hidden;
height: 20px;
width: 100%;
float: left;
left: 0px;
/*top: 65px;*/
margin: 0px;
padding: 0px;
border: 1px solid #333;
border-bottom: 1px solid #ccc;
color: #000000;
/* IE10 Consumer Preview */
background-image: -ms-linear-gradient(top, #666666 0%, #FFFFFF 100%);
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top, #666666 0%, #FFFFFF 100%);
/* Opera */
background-image: -o-linear-gradient(top, #666666 0%, #FFFFFF 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666666), color-stop(1, #FFFFFF));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top, #666666 0%, #FFFFFF 100%);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to bottom, #666666 0%, #FFFFFF 100%);
}
.clientname {
float: right;
margin-right: 120px;
color: #000000;
font-weight: bold;
}
#bod {
position: absolute;
width: 100%;
float: left;
left: 0px;
top: 85px;
margin: 0px;
padding: 0px;
color: #000000;
}
Here is a JSfiddle: http://jsfiddle.net/Artsen/HYZLR/
Thanks
I am currently adding a navigation bar to a web page. But I am running into some css styling issues. The navigation menu bar is pushing the content below, leaving a huge gap in between and making it uneven. I took the precaution in leaving out anything that will mess with the bottom like margin bottom-padding but I am still getting the same result. How can I get the menu bar to not affect the content below? EXAMPLE
With the Navigation bar added:
Without navigation bar the contents below are even:
I have added the specific css rules that are causing the issue to devgrow.css:
<style>
#navigation {
position:relative;
top:-45px;
left:450px;
}
#au_title {
color: #FC821D;
font-size: 120%;
font-weight: bold;
left: 515px;
letter-spacing: 2px;
position: relative;
text-transform: uppercase;
top: -105px;
}
#searchInput {
left: 700px;
position: relative;
top: -180px;
}
#contentNav { color: #cfdae3; }
/* Dark Button CSS */
.buttonNav {
outline: 0;
padding: 5px 12px;
display: block;
color: #EBEBEB;
font-weight: bold;
text-shadow: 1px 1px #1f272b;
border: 1px solid #1c252b;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background: #232B30; /* old browsers */
background: -moz-linear-gradient(top, #3D4850 3%, #313d45 4%, #232B30 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#3D4850), color-stop(4%,#313d45), color-stop(100%,#232B30)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3D4850', endColorstr='#232B30',GradientType=0 ); /* ie */
box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */
}
.buttonNav:hover {
color: #fff;
background: #4C5A64; /* old browsers */
background: -moz-linear-gradient(top, #4C5A64 3%, #404F5A 4%, #2E3940 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#4C5A64), color-stop(4%,#404F5A), color-stop(100%,#2E3940)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C5A64', endColorstr='#2E3940',GradientType=0 ); /* ie */
}
.buttonNav:active {
background-position: 0 top;
position: relative;
top: 1px;
color: #fff;
padding: 6px 12px 4px;
background: #20282D; /* old browsers */
background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */
-moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */
-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */
box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
}
/* Other stuff: */
.button-list { list-style: none; width: 100%; float: left; display: block; }
.button-list li { float: left; margin: 0 5px 0 0; }
.button-list li.search { padding-left: 18px; margin-left: 10px; position: relative; }
/* Search CSS: */
.search-input {
padding: 0 5px 0 22px;
border: 2px solid #DADADA;
height: 30px;
font-size: 12px;
line-height: 30px;
border-radius: 25px;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
background: #FFF; /* old browsers */
}
.search-input:focus {outline: none;}
.search-submit {
width: 13px;
height: 13px;
border: none;
background: url(images/mag-glass.png) no-repeat;
display: block;
position: absolute;
left: 26px;
top: 10px;
text-indent: -9999em;
}
</style>
First i have say that the coding is really bad. For fixed that issue remove float from you button-list. Write like this :
.button-list {
list-style: none outside none;
overflow: hidden;
}
Hey now define overflow hidden in your css #contentArea id
as like this
#contentArea {
overflow: hidden;
}
Add style clear both in css of first content area
<div id="contentArea" style="clear:both">
I have a drop down menu that's working just fine in Chrome and Safari, but when testing it in Firefox and IE, the dropdown box is longer down and therefore unreachable.
<!--produkter dropdown -->
<div id="dropmenu1" class="dropmenudiv">
RAW Frames
PROJECT 321
CAMSPORTS
FOSS
</div>
<!--medie dropdown -->
<div id="dropmenu2" class="dropmenudiv" style="width: 113px;">
TEST RIDE
HOW TO
RIDERS VIEW
</div>
.dropmenudiv{
position: absolute;
margin-top: 36px;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-left: 1px solid #333;
border-right: 1px solid #333;
border-bottom: 1px solid #333;
font-size: 12px;
font-weight: bold;
line-height: 26px;
z-index: 100;
background: -moz-linear-gradient(top, #424141, #262626); /* Mozilla */
background: -webkit-gradient(linear, left top, left bottom, from(#424141), to(#262626)); /* Chrome-Safari */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#424141', endColorstr='#262626'); /* IE */
width: 137px;
visibility: hidden;
}
.dropmenudiv a{
width: auto;
display: block;
text-indent: 5px;
padding: 2px 0;
text-decoration: none;
color: black;
padding-left: 5px;
}
* html .dropmenudiv a{ /*IE only hack*/
width: 100%;
}
.dropmenudiv a:hover{
background: -moz-linear-gradient(top, #545454, #2c2c2c); /* Mozilla */
background: -webkit-gradient(linear, left top, left bottom, from(#545454), to(#2c2c2c)); /* Chrome-Safari */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545454', endColorstr='#2c2c2c'); /* IE */
}
I have read a lot around the net and can see that a lot of other people have similar problems with Firefox not showing the div the same place as in Chrome and other browsers.
The attribute position:absolute causes this issue. Try this code instead what you have used.
http://jsfiddle.net/AAgfF/2/