HTML 5 Button wont align to the far right of text area - html

How can I float the button all the way right?
I've tried everyhting to float it right, and change the position to absolute, but I have had no luck pushing the button to the right edge of the text area.
http://jsfiddle.net/hz0fo895/
#counter { float:left; position:relative; margin-left:20px; margin-top:5px;}
.stringsharewrapper { width:100%; height:auto; margin-top:10px; }
.writestring { width:90%; left:20px; height:80px; position:relative; margin-top:10px; }
.stringtitle { color:black; font-family:arial; font-family: Helvetica, Arial, "Sans Serif"; font-size:20px; font-weight:bold; margin-left:20px; margin-top:5px;}
/*----------Filter Button 1 ------------*/
#stringbutton2[type=checkbox]
{
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
[for="stringbutton2"]
{
background: #EEE;
background: linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -moz-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -ms-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -o-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#FFBF00),color-stop(100%,#FE9A2E));
background: -webkit-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
border: 1px solid #CCC;
border-radius: 5px;
box-shadow: inset 0px 0px 1px 0px #FFF;
color: #000;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFBF00',endColorstr='#FE9A2E',GradientType=0);
font-family: Helvetica,Arial,"Sans Serif";
font-size: 13px;
font-weight: bold;
left: 5%;
moz-border-radius: 5px;
moz-box-shadow: inset 0px 0px 1px 0px #FFF;
padding: 0;
padding: 6px;
position: absolute;
text-align: center;
text-shadow: 1px 1px 1px #DDD;
top: 4px;
webkit-border-radius: 5px;
webkit-box-shadow: inset 0px 0px 1px 0px #FFF;
width: 100px;
}
[for="stringbutton2"]:hover
{
background: #CCC;
background: -moz-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -ms-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -o-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#0B2F3A),color-stop(100%,#100719));
background: -webkit-linear-gradient(top,#0B2F3A 0%,#100719 100%);
border-color: #BBB;
color: #FFFFFF;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0B2F3A',endColorstr='#100719',GradientType=0);
font-weight: bold;
}
[for="stringbutton2"] span.filterswitch:last-of-type
{
display: none;
visibility: hidden;
}
#stringbutton2[type=checkbox]:checked
{
color: #FFA317;
}
#stringbutton2[type=checkbox]:checked~ .filtercontent
{
display: block;
visibility: visible;
width: 100%;
}
#stringbutton2[type=checkbox]:checked~ [for="stringbutton2"] span.filterswitch:first-of-type
{
display: none;
visibility: hidden;
}
#stringbutton2[type=checkbox]:checked~ [for="stringbutton2"] span.filterswitch:last-of-type
{
color: #3CC;
display: block;
visibility: visible;
}
/*-------------Filter Button Container---------------*/
.submitcontainer
{
position: relative;
width: 300px; top:0; float:right;
}
<div class="sharepagetab sharewrapper activeshare" id="ashare">
<div class="allshares">
<div class="shares">
<div class='stringsharewrapper'>
<span class="stringtitle">Write Something</span><br />
<textarea class="writestring" onKeyUp="textCounter2(this,'counter',150);"></textarea>
<br />
<input disabled class="charInput" size="3" value="150" id="counter">
<!----------Write button------------>
<div class="submitcontainer">
<input onclick="toggleContent()" type="checkbox" id="stringbutton2" class="cfilterbutton" role="button">
<label for="stringbutton2" onclick="">
<span class="filterswitch">Post</span>
<span class="filterswitch">Post</span>
</label>
</div><!----End Filtercontainer------->
</div>

Remove the width on submitcontainer. That will cause the Post button to float all the way right. This however will not cause it to line up with your textbox as the textbox is autosizing. You probably want another div around the "Write Something" text and text input with a specified width that matches the width of your submitcontainer div if you want things to work as you desire.

Quick fix. Use a negative value of margin-right to fix it.
#counter { float:left; position:relative; margin-left:20px; margin-top:5px;}
.stringsharewrapper { width:100%; height:auto; margin-top:10px; }
.writestring { width:90%; left:20px; height:80px; position:relative; margin-top:10px; }
.stringtitle { color:black; font-family:arial; font-family: Helvetica, Arial, "Sans Serif"; font-size:20px; font-weight:bold; margin-left:20px; margin-top:5px;}
/*----------Filter Button 1 ------------*/
#stringbutton2[type=checkbox]
{
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
[for="stringbutton2"]
{
background: #EEE;
background: linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -moz-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -ms-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -o-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#FFBF00),color-stop(100%,#FE9A2E));
background: -webkit-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
border: 1px solid #CCC;
border-radius: 5px;
box-shadow: inset 0px 0px 1px 0px #FFF;
color: #000;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFBF00',endColorstr='#FE9A2E',GradientType=0);
font-family: Helvetica,Arial,"Sans Serif";
font-size: 13px;
font-weight: bold;
left: 5%;
moz-border-radius: 5px;
moz-box-shadow: inset 0px 0px 1px 0px #FFF;
padding: 0;
padding: 6px;
position: absolute;
text-align: center;
text-shadow: 1px 1px 1px #DDD;
top: 4px;
webkit-border-radius: 5px;
webkit-box-shadow: inset 0px 0px 1px 0px #FFF;
width: 100px;
}
[for="stringbutton2"]:hover
{
background: #CCC;
background: -moz-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -ms-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -o-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#0B2F3A),color-stop(100%,#100719));
background: -webkit-linear-gradient(top,#0B2F3A 0%,#100719 100%);
border-color: #BBB;
color: #FFFFFF;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0B2F3A',endColorstr='#100719',GradientType=0);
font-weight: bold;
}
[for="stringbutton2"] span.filterswitch:last-of-type
{
display: none;
visibility: hidden;
}
#stringbutton2[type=checkbox]:checked
{
color: #FFA317;
}
#stringbutton2[type=checkbox]:checked~ .filtercontent
{
display: block;
visibility: visible;
width: 100%;
}
#stringbutton2[type=checkbox]:checked~ [for="stringbutton2"] span.filterswitch:first-of-type
{
display: none;
visibility: hidden;
}
#stringbutton2[type=checkbox]:checked~ [for="stringbutton2"] span.filterswitch:last-of-type
{
color: #3CC;
display: block;
visibility: visible;
}
.submitcontainer
{ position: relative; width: 300px; top:0; float:right!important; margin-right: -135px;
}
<div class="sharepagetab sharewrapper activeshare" id="ashare">
<div class="allshares">
<div class="shares">
<div class='stringsharewrapper'>
<span class="stringtitle">Write Something</span><br />
<textarea class="writestring" onKeyUp="textCounter2(this,'counter',150);"></textarea>
<br />
<input disabled class="charInput" size="3" value="150" id="counter">
<!----------Write button------------>
<div class="submitcontainer">
<input onclick="toggleContent()" type="checkbox" id="stringbutton2" class="cfilterbutton" role="button">
<label for="stringbutton2" onclick="">
<span class="filterswitch">Post</span>
<span class="filterswitch">Post</span>
</label>
</div><!----End Filtercontainer------->
</div>

I found the answer following some of the tips of Devon posted and expanding on the concept. What I did was put a wrapper .stringclassic with 90% width and placed all the children inside and floated them accordingly. Check out my code for more informaton or the fiddle. Hope I can help someone else lookin for this information.
Thank you All!
http://jsfiddle.net/L0f48606/1/
<div class="sharepagetab sharewrapper activeshare" id="ashare">
<div class="allshares">
<div class="shares">
<div class='stringsharewrapper'>
<div class="stringclassic">
<span class="stringtitle">Write Something</span> <br />
<textarea class="writestring" onKeyUp="textCounter2(this,'counter',150);"></textarea>
<br />
<input disabled class="charInput" size="3" value="150" id="counter">
<!----------Write button------------>
<div class="submitcontainer">
<input onclick="toggleContent()" type="checkbox" id="stringbutton2" class="cfilterbutton" role="button">
<label for="stringbutton2" onclick="">
<span class="filterswitch">Post</span>
<span class="filterswitch">Post</span>
</label>
</div><!----End Filtercontainer------->
</div>
</div>
</div>
</div>
</div>
And the CSS:
#counter { float:left; position:relative; margin-left:20px; margin-top:5px;}
.stringsharewrapper { width:100%; height:auto; margin-top:10px; background:pink; position:relative;}
.writestring { width:90%; left:20px; height:80px; position:relative; margin-top:10px; }
.stringtitle { color:black; font-family:arial; font-family: Helvetica, Arial, "Sans Serif"; font-size:20px; font-weight:bold; float:left; position:relative; margin-left:20px; margin-top:5px;}
/*----------Filter Button 1 ------------*/
#stringbutton2[type=checkbox]
{
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
[for="stringbutton2"]
{
background: #EEE;
background: linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -moz-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -ms-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -o-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#FFBF00),color-stop(100%,#FE9A2E));
background: -webkit-linear-gradient(top,#FFBF00 0%,#FE9A2E 100%);
border: 1px solid #CCC;
border-radius: 5px;
box-shadow: inset 0px 0px 1px 0px #FFF;
color: #000;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFBF00',endColorstr='#FE9A2E',GradientType=0);
font-family: Helvetica,Arial,"Sans Serif";
font-size: 13px;
font-weight: bold;
left: 5%;
moz-border-radius: 5px;
moz-box-shadow: inset 0px 0px 1px 0px #FFF;
padding: 0;
padding: 6px;
position: absolute;
text-align: center;
text-shadow: 1px 1px 1px #DDD;
top: 4px;
webkit-border-radius: 5px;
webkit-box-shadow: inset 0px 0px 1px 0px #FFF;
width: 100px;
}
[for="stringbutton2"]:hover
{
background: #CCC;
background: -moz-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -ms-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -o-linear-gradient(top,#0B2F3A 0%,#100719 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#0B2F3A),color-stop(100%,#100719));
background: -webkit-linear-gradient(top,#0B2F3A 0%,#100719 100%);
border-color: #BBB;
color: #FFFFFF;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0B2F3A',endColorstr='#100719',GradientType=0);
font-weight: bold;
}
[for="stringbutton2"] span.filterswitch:last-of-type
{
display: none;
visibility: hidden;
}
#stringbutton2[type=checkbox]:checked
{
color: #FFA317;
}
#stringbutton2[type=checkbox]:checked~ .filtercontent
{
display: block;
visibility: visible;
width: 100%;
}
#stringbutton2[type=checkbox]:checked~ [for="stringbutton2"] span.filterswitch:first-of-type
{
display: none;
visibility: hidden;
}
#stringbutton2[type=checkbox]:checked~ [for="stringbutton2"] span.filterswitch:last-of-type
{
color: #3CC;
display: block;
visibility: visible;
}
/*-------------Filter Button Container---------------*/
.stringclassic { width:90%; left:20px; height:80px; position:relative; margin-top:1px; float:left; }
.writestring { width:100%; height:80px; position:relative; margin-top:10px; }
.submitcontainer
{
position: relative; margin-right:90px;
top:0; float:right; display:inline-block;
}

Related

Why wont my button center in a div? The button is in a wrapper that has text-align:center

I can't seem to figure out why my button won't center!
I have a button that appears when you click on a div element
This button is just a "Collect loot" button but for some reason, it won't center itself!
I wrapped the button in a <p class="wrapper" style="text-align:center> type deal yet the button still wont center itself!
.btnwrapcenter {
text-align: center;
}
<p class="btnwrapcenter">
<button class="enemybattlevisibility" id="CollectLootButton">Collect</button>
</p>
Here is a codepen link for better investigation:
https://codepen.io/jonloft/pen/rNdaQjG
Set the display of the button to inline which is set to block in your js code
document.getElementById("CollectLootButton").style.display = "inline";
Full code:
// The variables.
tankhealth = 10,
healerhealth = 10,
dpshealth = 10,
tankdamage = 5,
healerdamage = 1,
dpsdamage = 0.5,
tankattackspeed = 2500,
healerattackspeed = 5000,
dpsattackspeed = 1500,
enemyhealthvalue = 20,
enemyhealthmaxvalue = 20,
enemydamage = 1,
enemyattackspeed = 3,
currentzone = 0,
refreshtankattackinterval = 0,
lootamount = 0
var ElwynnForestEnemyArray = ['Kobold', 'Murloc', 'Wolf', 'Bear', 'Spider'];
function tankattackenemy() {
var enemyhealthprogressbar = document.getElementById("EnemyHealthBarId");
console.log(enemyhealthprogressbar);
var enemyattackinterval = setInterval(() => {
if (enemyhealthvalue > 0) {
enemyhealthvalue -= tankdamage;
}
console.log(enemyhealthvalue);
enemyhealthprogressbar.setAttribute("value", enemyhealthvalue);
enemyhealthprogressbar.setAttribute("max", enemyhealthmaxvalue);
enemyhealthprogressbar.setAttribute("data-label", enemyhealthvalue + "/" + enemyhealthmaxvalue);
if (enemyhealthvalue == 0) {
selectelwynnforestzone();
clearInterval(enemyattackinterval);
enemyhealthprogressbar.setAttribute("value", enemyhealthvalue);
enemyhealthprogressbar.setAttribute("max", enemyhealthmaxvalue);
enemyhealthprogressbar.setAttribute("data-label", enemyhealthvalue + "/" + enemyhealthmaxvalue);
if (lootamount < 10) {
lootamount += 1;
document.getElementById("CollectLootText").innerHTML = "Loot (" + lootamount + "/" + "10" + ")"
}
}
}, tankattackspeed);
}
function dpsattackenemy() {
}
function healerhealplayer() {
}
function selectelwynnforestzone() {
var currentzone = 1;
const randomelwynnenemy = Math.floor(Math.random() * ElwynnForestEnemyArray.length);
console.log(randomelwynnenemy, ElwynnForestEnemyArray[randomelwynnenemy]);
document.getElementById("EnemyNameText").innerHTML = ElwynnForestEnemyArray[randomelwynnenemy];
document.getElementById("battle_enemy_loader_container_id").style.display = "block";
document.getElementById("SelectZoneBeforeTextId").style.display = "none";
//Kobold
if (randomelwynnenemy == 0) {
enemyhealthvalue = 20;
enemyhealthmaxvalue = 20;
}
//Murloc
if (randomelwynnenemy == 1) {
enemyhealthvalue = 20;
enemyhealthmaxvalue = 20;
}
//Wolf
if (randomelwynnenemy == 2) {
enemyhealthvalue = 20;
enemyhealthmaxvalue = 20;
}
//Bear
if (randomelwynnenemy == 3) {
enemyhealthvalue = 20;
enemyhealthmaxvalue = 20;
}
//Spider
if (randomelwynnenemy == 4) {
enemyhealthvalue = 20;
enemyhealthmaxvalue = 20;
}
setTimeout(() => {
const enemybattleloadertimer = document.getElementById("battle_enemy_loader_id")
enemybattleloadertimer.style.display = "none";
document.getElementById("enemy_stats_text_id").style.display = "block";
document.getElementById("EnemyNameText").style.display = "block";
document.getElementById("EnemyHealthBarId").style.display = "block";
document.getElementById("CollectLootText").style.display = "block";
/* modified line of the code */
document.getElementById("CollectLootButton").style.display = "inline";
}, 700);
tankattackenemy();
}
body {
margin: 0;
padding: 0;
}
#battle_enemy_loader_container_id {
text-align: center;
vertical-align: center;
}
.battle_enemy_loader {
border: 10px solid #f3f3f3;
border-top: 10px solid #3498db;
border-radius: 50%;
width: 2em;
height: 2em;
animation: spin 2s linear infinite;
display: inline-block;
}
#keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.textwrapcenter {
text-align: center;
}
.btnwrapcenter {
text-align: center;
}
progress {
text-align: center;
}
.progressbarwrapcenter {
text-align: center;
}
#CollectLootText {
text-align: center;
}
.party_container {
width: 100%;
display: flex;
position: relative;
min-height: 8em;
}
.Player1HealthBar {
height: 1.5em;
width: 100%;
background-color: #c9c9c9;
position: relative;
font-weight: bold;
float: left;
}
.Player1HealthBar:before {
content: attr(data-label);
font-size: 1em;
position: absolute;
text-align: center;
top: 5px;
left: 0;
right: 0;
}
.Player1HealthBar .value {
background-color: #05a000;
display: inline-block;
height: 100%;
}
.Player1ManaBar {
height: 1.5em;
width: 100%;
background-color: #c9c9c9;
position: relative;
font-weight: bold;
float: right;
}
.Player1ManaBar:before {
content: attr(data-label);
font-size: 1em;
position: absolute;
text-align: center;
top: 5px;
left: 0;
right: 0;
}
.Player1ManaBar .value {
background-color: #1663be;
display: inline-block;
height: 100%;
}
.Player2HealthBar {
height: 1.5em;
width: 100%;
background-color: #c9c9c9;
position: relative;
font-weight: bold;
float: left;
}
.Player2HealthBar:before {
content: attr(data-label);
font-size: 1em;
position: absolute;
text-align: center;
top: 5px;
left: 0;
right: 0;
}
.Player2HealthBar .value {
background-color: #05a000;
display: inline-block;
height: 100%;
}
.Player2ManaBar {
height: 1.5em;
width: 100%;
background-color: #c9c9c9;
position: relative;
font-weight: bold;
float: right;
}
.Player2ManaBar:before {
content: attr(data-label);
font-size: 1em;
position: absolute;
text-align: center;
top: 5px;
left: 0;
right: 0;
}
.Player2ManaBar .value {
background-color: #1663be;
display: inline-block;
height: 100%;
}
.Player3HealthBar {
height: 1.5em;
width: 100%;
background-color: #c9c9c9;
position: relative;
font-weight: bold;
float: left;
}
.Player3HealthBar:before {
content: attr(data-label);
font-size: 1em;
position: absolute;
text-align: center;
top: 5px;
left: 0;
right: 0;
}
.Player3HealthBar .value {
background-color: #05a000;
display: inline-block;
height: 100%;
}
.Player3ManaBar {
height: 1.5em;
width: 100%;
background-color: #c9c9c9;
position: relative;
font-weight: bold;
float: right;
}
.Player3ManaBar:before {
content: attr(data-label);
font-size: 1em;
position: absolute;
text-align: center;
top: 5px;
left: 0;
right: 0;
}
.Player3ManaBar .value {
background-color: #1663be;
display: inline-block;
height: 100%;
}
.EnemyHealthBar {
height: 1em;
width: 100%;
background-color: #c9c9c9;
position: relative;
font-weight: bold;
float: left;
}
.EnemyHealthBar:before {
content: attr(data-label);
font-size: 0.8em;
position: absolute;
text-align: center;
top: 15%;
left: 0;
right: 0;
}
.EnemyHealthBar .value {
background-color: #05a000;
display: inline-block;
height: 100%;
}
.main_battle_div {
display: flex;
}
.player1_battle_info_div {
width: 33.3%;
float: left;
flex: 1;
}
.player1_battle_info_left_div {
position: relative;
width: 33.3%;
float: left;
height: 100%;
}
.player1_battle_info_center_div {
position: relative;
width: 33.3%;
float: left;
height: 100%;
}
.player1_battle_info_right_div {
position: relative;
width: 31.9%;
float: left;
height: 100%;
}
.player2_battle_info_div {
width: 33.3%;
float: left;
flex: 1;
}
.player2_battle_info_left_div {
position: relative;
width: 33.3%;
float: left;
height: 100%;
}
.player2_battle_info_center_div {
position: relative;
width: 33.3%;
float: left;
height: 100%;
}
.player2_battle_info_right_div {
position: relative;
width: 31.9%;
float: left;
height: 100%;
}
.player3_battle_info_div {
width: 33.3%;
float: left;
flex: 1;
}
.player3_battle_info_left_div {
position: relative;
width: 33.3%;
float: left;
height: 100%;
}
.player3_battle_info_center_div {
position: relative;
width: 33.3%;
float: left;
height: 100%;
}
.player3_battle_info_right_div {
position: relative;
width: 31.9%;
float: left;
height: 100%;
}
.battle_enemy_div {
width: 33.3%;
float: left;
flex: 1;
}
.battle_enemy_left_div {
float: left;
position: relative;
width: 33.3%;
height: 100%;
}
.battle_enemy_center_div {
float: left;
position: relative;
width: 33.3%;
height: 100%;
}
.battle_enemy_right_div {
float: left;
position: relative;
width: 31.9%;
height: 100%;
}
.SelectZoneBeforeText {
display: block;
}
.zone_selection_div {
border: 1px solid gray;
width: 33.3%;
float: left;
flex: 1;
padding: 0.5em;
}
.party_container {
bottom: 30px;
position: absolute;
}
.enemybattlevisibility {
display: none;
}
#ElwynnForestZoneBox {
width: 6em;
height: 2.5em;
background-color: white;
}
#WestFallZoneBox {
width: 6em;
height: 2.5em;
background-color: white;
}
p.clean {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 11;
margin-bottom: 0;
margin-top: 0px;
}
p.clean2 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 11;
margin-bottom: 0;
margin-top: 0px;
}
p.clean3 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 11;
margin-bottom: 3px;
margin-top: 0px;
}
p.console {
font-family: "Lucida Sans Typewriter", "Lucida Console", Monaco, "Bitstream Vera Sans Mono", monospace;
font-size: 12;
color: white;
margin-top: 0;
}
p.consoleOld {
font-family: "Lucida Sans Typewriter", "Lucida Console", Monaco, "Bitstream Vera Sans Mono", monospace;
font-size: 12;
color: grey;
margin-bottom: 0;
}
.button {
border: 1px solid #1a1a1a;
background: #666666;
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc));
background: -webkit-linear-gradient(top, #ffffff, #888888);
background: -moz-linear-gradient(top, #ffffff, #888888);
background: -ms-linear-gradient(top, #ffffff, #888888);
background: -o-linear-gradient(top, #ffffff, #888888);
background-image: -ms-linear-gradient(top, #ffffff 0%, #888888 100%);
padding: 12.5px 25px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 1px 0, inset rgba(255, 255, 255, 0.4) 0 1px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 1px 0, inset rgba(255, 255, 255, 0.4) 0 1px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 1px 0, inset rgba(255, 255, 255, 0.4) 0 1px 0;
text-shadow: #cccccc 0 1px 0;
color: #000000;
font-size: 16px;
font-family: helvetica, serif;
text-decoration: none;
vertical-align: middle;
outline: none;
}
.button:hover {
border: 1px solid #898989;
text-shadow: #d4d4d4 0 1px 0;
background: #666666;
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#666666));
background: -webkit-linear-gradient(top, #ffffff, #666666);
background: -moz-linear-gradient(top, #ffffff, #666666);
background: -ms-linear-gradient(top, #ffffff, #666666);
background: -o-linear-gradient(top, #ffffff, #666666);
background-image: -ms-linear-gradient(top, #ffffff 0%, #666666 100%);
color: #000000;
}
.button:active {
text-shadow: #bfbfbf 0 1px 0;
border: 1px solid #2e2e2e;
background: #d9d9d9;
background: -webkit-gradient(linear, left top, left bottom, from(#595959), to(#616161));
background: -webkit-linear-gradient(top, #595959, #d9d9d9);
background: -moz-linear-gradient(top, #595959, #d9d9d9);
background: -ms-linear-gradient(top, #595959, #d9d9d9);
background: -o-linear-gradient(top, #595959, #d9d9d9);
background-image: -ms-linear-gradient(top, #595959 0%, #d9d9d9 100%);
color: #000000;
}
.button:disabled {
opacity: 0.6;
border: 1px solid #ffffff;
}
.button2 {
border: 1px solid #1a1a1a;
background: #666666;
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc));
background: -webkit-linear-gradient(top, #ffffff, #888888);
background: -moz-linear-gradient(top, #ffffff, #888888);
background: -ms-linear-gradient(top, #ffffff, #888888);
background: -o-linear-gradient(top, #ffffff, #888888);
background-image: -ms-linear-gradient(top, #ffffff 0%, #888888 100%);
padding: 2px 4px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 1px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 1px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 1px 0;
text-shadow: #cccccc 0 1px 0;
color: #000000;
font-size: 11px;
font-family: helvetica, serif;
text-decoration: none;
vertical-align: middle;
outline: none;
}
.button2:hover {
border: 1px solid #898989;
text-shadow: #d4d4d4 0 1px 0;
background: #616161;
background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#888888));
background: -webkit-linear-gradient(top, #f7f7f7, #888888);
background: -moz-linear-gradient(top, #f7f7f7, #888888);
background: -ms-linear-gradient(top, #f7f7f7, #888888);
background: -o-linear-gradient(top, #f7f7f7, #888888);
background-image: -ms-linear-gradient(top, #f7f7f7 0%, #888888 100%);
color: #000000;
}
.button2:active {
text-shadow: #bfbfbf 0 1px 0;
border: 1px solid #2e2e2e;
background: #d9d9d9;
background: -webkit-gradient(linear, left top, left bottom, from(#595959), to(#616161));
background: -webkit-linear-gradient(top, #595959, #d9d9d9);
background: -moz-linear-gradient(top, #595959, #d9d9d9);
background: -ms-linear-gradient(top, #595959, #d9d9d9);
background: -o-linear-gradient(top, #595959, #d9d9d9);
background-image: -ms-linear-gradient(top, #595959 0%, #d9d9d9 100%);
color: #444444;
}
.button2:disabled {
opacity: 0.6;
border: 1px solid #ffffff;
}
<header>
<h1 id="GameTitleText" class="textwrapcenter">Hearth Idle</h1>
</header>
<div class="main_battle_div">
<div class="battle_enemy_div">
<div class="battle_enemy_left_div" style="border:1px solid gray">
<p id="enemy_stats_text_id" class="enemybattlevisibility" style="text-align:center;">Enemy Stats</p>
</div>
<div class="battle_enemy_center_div" style="border:1px solid gray">
<div id="battle_enemy_loader_container_id" class="enemybattlevisibility">
<div class="battle_enemy_loader" id="battle_enemy_loader_id">
</div>
</div>
<p id="SelectZoneBeforeTextId" class="SelectZoneBeforeText" style="text-align:center;">
Select a zone first!
</p>
<h2 id="EnemyNameText" class="textwrapcenter enemybattlevisibility"></h2>
<progress id="EnemyHealthBarId" class="EnemyHealthBar enemybattlevisibility" data-label='20/20' value="20" max="20">
</progress>
</div>
<div class="battle_enemy_right_div" style="border:1px solid gray">
<h3 id="CollectLootText" class="enemybattlevisibility">Loot (0/10)</h3>
<p class="btnwrapcenter">
<button class="enemybattlevisibility" id="CollectLootButton">Collect</button>
</p>
</div>
<br>
</div>
<div class="zone_selection_div">
<div id="ElwynnForestZoneBox" style="border:1px solid gray; cursor:pointer;" onclick="selectelwynnforestzone()">
<p style="font-size:0.8em;text-align:center;margin:auto">Elwynn Forest<br>(0-10)</p>
</div>
<br>
<div id="WestFallZoneBox" style="border:1px solid gray; cursor:pointer;" onclick="selectwestfallzone()">
<p style="font-size:0.8em;text-align:center;margin:auto;">West Fall<br>(10-20)</p>
</div>
</div>
<div class="party_container" style="border:1px solid gray">
<div class="player1_battle_info_div">
<div class="player1_battle_info_left_div" style="border:1px solid gray">
<div class="Player1HealthBar" data-label="10/10">
<span class="value" style="width:100%;"></span>
</div>
<br>
<p id="Player1DamageInfoText">Damage: 2</p>
</div>
<div class="player1_battle_info_center_div" style="border:1px solid gray">
<h2 id="BattleInfoUsernameText" class="textwrapcenter">Tank</h2>
</div>
<div class="player1_battle_info_right_div" style="border:1px solid gray">
<div class="Player1ManaBar" data-label="10/10">
<span class="value" style="width:100%;"></span>
</div>
</div>
</div>
<div class="player2_battle_info_div">
<div class="player2_battle_info_left_div" style="border:1px solid gray">
<div class="Player2HealthBar" data-label="10/10">
<span class="value" style="width:100%;"></span>
</div>
<br>
<p id="Player2HealingInfoText">Healing: 1</p>
</div>
<div class="player2_battle_info_center_div" style="border:1px solid gray">
<h2 id="BattleInfoUsernameText" class="textwrapcenter">Healer</h2>
</div>
<div class="player2_battle_info_right_div" style="border:1px solid gray">
<div class="Player2ManaBar" data-label="10/10">
<span class="value" style="width:100%;"></span>
</div>
</div>
</div>
<div class="player3_battle_info_div">
<div class="player3_battle_info_left_div" style="border:1px solid gray">
<div class="Player3HealthBar" data-label="10/10">
<span class="value" style="width:100%;"></span>
</div>
<br>
<p id="Player3DamageInfoText">Damage: 1</p>
</div>
<div class="player3_battle_info_center_div" style="border:1px solid gray">
<h2 id="BattleInfoUsernameText" class="textwrapcenter">DPS</h2>
</div>
<div class="player3_battle_info_right_div" style="border:1px solid gray">
<div class="Player3ManaBar" data-label="10/10">
<span class="value" style="width:100%;"></span>
</div>
</div>
</div>
</div>
</div>
.btnwrapcenter{
margin:0px;
position: absolute;
top: 50%;
left:50%;
}
<p class="btnwrapcenter">
<button class="enemybattlevisibility" id="CollectLootButton">Collect</button>
</p>
You can try this to center your div button

How to make div elements inside a div background image responsive using css

My question is this how do I make it work that the elements that are inside a div style=background-image work correctly when the screen gets smaller. In my case it seems that one of the elements inside the image box keeps the same height.
#main_article_box {
width: 728px;
height: 374px;
border: 1px solid #f8f8f8;
-moz-box-shadow: 0 2px 1px #9c9c9c;
-webkit-box-shadow: 0 2px 1px #9c9c9c;
box-shadow: 0 2px 1px #9c9c9c;
}
#main_article_text {
margin: 280px 3px 10px 3px;
height: 90px;
background: #ffffff;
border: 1px solid #f8f8f8;
background: #ffffff;
background: -moz-linear-gradient(#ffffff, #cccccc);
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(1, #ffffff));
background: -webkit-linear-gradient(#ffffff, #cccccc);
background: -o-linear-gradient(#ffffff, #cccccc);
background: -ms-linear-gradient(#ffffff, #cccccc);
background: linear-gradient(#ffffff, #cccccc);
/*-moz-border-radius: 1px;
border-radius: 1px;
-moz-box-shadow: 0 1px 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px #f8f8f8;
box-shadow: 0 1px 1px #f8f8f8;*/
opacity: 0.8;
filter: alpha(opacity=80);
}
#main_article_title {
font-size: 23px;
letter-spacing: -1px;
text-transform: uppercase;
text-shadow: #333;
font-weight: bold;
margin: 8px;
}
#main_article_short_text {
font-size: 14px;
width: 530px;
font-weight: bold;
margin: -2px 0 0 8px;
color: #333333;
}
#media only screen and (max-width: 460px) {
#main_article_box {
width: 100%;
height: auto;
}
#main_article_text {
width: 98%;
height: auto;
}
#main_article_title {
font-size: 16px;
}
#main_article_short_text {
font-size: 11px;
}
}
<div id="main_article_box" style="background-image: url(http://www.watchathletics.com/data/headline/9718/rio%20usain%20bolt.jpg); no-repeat center; background-size: 100% auto; ">
<div id="main_article_text">
<div id="main_article_title">Main Article Title for this post
</div>
<div id="main_article_short_text">
<p>This is some intro text the article below title. This is some intro text the article below title.</p>...
</div>
</div>
</div>
I removed some styles only for me to understand the code. Is this solution correct for you?
.wrapper {
position:relative;
width:728px;
max-width:100%;
}
.wrapper:after {
content: ' ';
clear: both;
display: block;
}
#main_article_box {
float:left;
width:100%;
height:auto;
border:0 none;
padding-top:51.37%;
background-size:cover;
}
#main_article_text {
position: absolute;
left: 0;
right: 0;
bottom: 0;
margin: 0 3px 3px 3px;
height: 90px;
background: #ffffff;
border: 1px solid #f8f8f8;
background: #ffffff;
background: -moz-linear-gradient(#ffffff, #cccccc);
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #cccccc),color-stop(1, #ffffff));
background: -webkit-linear-gradient(#ffffff, #cccccc);
background: -o-linear-gradient(#ffffff, #cccccc);
background: -ms-linear-gradient(#ffffff, #cccccc);
background: linear-gradient(#ffffff, #cccccc);
/*-moz-border-radius: 1px;
border-radius: 1px;
-moz-box-shadow: 0 1px 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px #f8f8f8;
box-shadow: 0 1px 1px #f8f8f8;*/
opacity:0.8;
filter:alpha(opacity=80);
}
#main_article_title {
font-size: 23px;
letter-spacing: -1px;
text-transform:uppercase;
text-shadow: #333;
font-weight: bold;
margin: 8px;
}
#main_article_short_text {
font-size: 14px;
width: auto;
font-weight:bold;
margin: -2px 0 0 8px;
color: #333333;
}
#media only screen and (max-width: 460px) {
#main_article_box {
width: 100%;
height: auto;
}
#main_article_text {
width: 98%;
height: auto;
}
#main_article_title {
font-size: 16px;
}
#main_article_short_text {
font-size: 11px;
}
}
<div class="wrapper">
<div id="main_article_box" style="background-image: url(http://www.watchathletics.com/data/headline/9718/rio%20usain%20bolt.jpg);">
<div id="main_article_text">
<div id="main_article_title">Main Article Title for this post</div>
<div id="main_article_short_text"><p>This is some intro text the article below title. This is some intro text the article below title. </p>...</div>
</div>
</div>
</div>

Div is positioned higher in Firefox than it is in Chrome

So here's the code:
html:
<!DOCTYPE html>
<html >
<script src="main.js"></script>
<head>
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>בנה את המחשב שלך בצורה אוטומטית!</title>
<meta name="description" content="Build your PC Generator - Israel.">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="hint.css">
<script>
window.addEventListener("load", function(){
var slider = document.getElementById("slider");
slider.addEventListener("mousemove", function(){
document.getElementById("output").innerHTML = this.value + "₪";
});
});
</script>
</head>
<body >
<div id="welcome"> <div id="welcome-message-box"> <img src="images/logo.png" id="logo"> <h1 dir="rtl" style="text-align:center; color:#fff;font-weight: 100;">ChooseYourPc.com</h1> <p dir="rtl" style="text-align:center; color:#fff; ">
האתר נוצר על מנת לתת מענה למתחילים אשר רוצים לבנות מחשב משל עצמם. המחירים והחלקים מעודכנים באופן קבוע בהתאם למצב הנוכחי, האתר יהפוך את החיים שלכם לקלים יותר על ידי מתן רשימת חלקים שאיתה תוכלו להתחיל ולאחר מכן לשנות לפי הצרכים והעדפות שלכם. <br><br>
האתר פותר את הבעיה הכי קשה שבה אנו נתקלים כאשר בונים מחשב: לדעת אילו חלקים לבחור ולוודא שכל החלקים מתאימים ב-100%. תהנו ממאגר של מפרטי מחשב מומלצים לכל תקציב באשר הוא, כולם מאוזנים היטב ומהווים תמורה טובה למחיר.
</p> <button class="myButtonwhite" id='btnscrl' onclick="smoothScroll(document.getElementById('content'))" style=" margin-left:39%; position: relative; ">!בואו נתחיל</button></div> <div style="cursor: pointer;" class="arrow bounce" onclick="smoothScroll(document.getElementById('content'))"> </div></div>
<div id="content" style=" max-width: 800px; margin-left:auto;margin-right:auto; position:relative;">
<h1 align='center'> !בנה את מחשב הגיימינג שלך</h1>
<div> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- auto ad -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9838071461609147"
data-ad-slot="2078936312"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
<div style="border-bottom:1px solid #e6e6e6;"></div>
<h2 align='center'> ?כמה תרצה להוציא</h2>
<p dir="rtl" align='center'>
זה מה שישפיע על ביצועי המחשב שלך, מן הסתם.
<br>
</p>
<p align='center' dir="rtl" style="font-style: italic; "> בדיוק כמו שחשוב להמנע מהוצאות יתר על המחשב, חשוב גם לדאוג שהתקציב לא יהיה נמוך מידי בהתאם לדרישותך, שים לב. <br>
תוכל למצוא מבחני ביצועים של כרטיסי המסך המופיעים במפרטים כדי לראות את הביצועים המשוערים של המפרט שקיבלת.
</p>
<input type="range" id="slider" value="2000" onchange="bla()" step='25' min='2000' max="6000"> <div style="margin-left:100%; border: 0px solid #f5f5f5; height: 37px; width: 60px; border-radius: 0px; background: #6b6b6b; cursor: pointer; -webkit-appearance: none; margin-top: -44px; z-index:'9999';"><div id='output' style="text-align: center; color:white;line-height: 37px;;">2000₪</div></div>
<br>
<h2 align='center' dir="rtl"> תרצה לבצע Overclock על המעבד?</h2>
<div style="border-bottom:1px solid #e6e6e6;"></div>
<p dir="rtl" align='center'>
Overclocking הוא התהליך של כוונון רכיבי המחשב כדי לגרום להם לעבוד קשה יותר. לכל רכיב חומרה שנמצא במחשב שלכם יש מהירות שעון המשמשת כברירת מחדל ובמהירות זו יוצא הרכיב מהמפעל. Overclocking הוא התהליך של הגדלת מהירות השעון של הרכיב מעבר למהירות ברירת המחדל.
<br>
</p>
<p align='center' dir="rtl" style="font-style: italic; "> אל תחשבו שזה הכרחי, לפעמים ניתן לקבל מחשב טוב יותר עבור הכסף שאותו תצטרכו לבזבז על מנת להתאים את המחשב שלכם לOverclocking. תבחרו את האופציה הזאת אך ורק אם אתם יודעים מה אתם עושים ואתם נלהבים מהנושא.
</p>
<div id="choices">
<button class="hint--bottom" data-hint="בקרוב ..." dir="rtl" id='ChoiceButton' >אני לא מעוניין </button>
<button class="hint--bottom" data-hint="בקרוב ..." id='ChoiceButton' dir="rtl">אולי בעתיד</button>
<button class="hint--bottom" data-hint="בקרוב ..." id='ChoiceButton' dir="rtl">אני מעוניין לעשות Overclock</button>
</div>
<h2 align='center' dir="rtl" id="moreoptions">אפשרויות נוספות</h2>
<div style="border-bottom:1px solid #e6e6e6;"></div>
<p dir="rtl" align='center'>
כאן אתם יכולים להתאים אישית מספר דברים נוספים כמו האם להוסיף Windows אם אתם צריכים מערכת הפעלה, או האם לכלול כונן אופטי.
<br>
</p>
<p align='center' dir="rtl" style="font-style: italic; "> שימו לב שכמובן שככל שתבחרו ביותר אופציות כך גם התקציב שילך על המחשב עצמו ירד, ומן הסתם הביצועים לא יהיו זהים.
</p>
<div id="choices2">
<button id='windowsAdd' dir="rtl" value="0" onclick="btnColor(this, 'rgb(107,107,107)');bla()" >הוספת Windows</button>
<button id='dvdburner' dir="rtl" value="0" onclick="btnColor(this, 'rgb(107,107,107)');bla()">הוספת צורב</button>
</div>
<br>
<div class="alert" id="alert" role="alert"></div>
<div style="border-bottom:1px solid #e6e6e6; margin-bottom:20px;"></div>
<div style="text-align:center;margin:auto;">
<button class="myButton" id='btn' onclick="show()" style=" position: relative;">בנה מחשב</button> </div>
<div id = "myDiv" align='center' style="display:none; margin"><img id = "myImage" src = "images/loading.gif"></div>
<br><br><br><br><br><br><br><br><br><br><br>
<p align="middle"> עדכון נתונים אחרון: 15/04/2016</p>
</div>
<div id="footer"> <p id="rights">כל הזכויות שמורות © 2016 BuildYourPc </p> <p id="creator">נוצר על-ידי א י ת י </p></div>
</body>
</html>
<!--
[[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]
[:::::::::::::: ::::::::::::::]
[:::::::::::::: ::::::::::::::]
[::::::[[[[[[[: :]]]]]]]::::::]
[:::::[ ]:::::]
[:::::[ ]:::::]
[:::::[ ]:::::]
[:::::[ ]:::::]
[:::::[ CODE THE WEB ]:::::]
[:::::[ http://brackets.io ]:::::]
[:::::[ ]:::::]
[:::::[ ]:::::]
[:::::[ ]:::::]
[:::::[ ]:::::]
[::::::[[[[[[[: :]]]]]]]::::::]
[:::::::::::::: ::::::::::::::]
[:::::::::::::: ::::::::::::::]
[[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]
-->
CSS:
html {
background-color: #fff;
-webkit-font-smoothing: antialiased;
height: 100%;
margin: 0px;
padding: 0px;
overflow-x: hidden;
box-sizing: border-box;
overflow: scroll;
overflow-x: hidden;
}
#keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Firefox < 16 */
#-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Safari, Chrome and Opera > 12.1 */
#-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Internet Explorer */
#-ms-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Opera < 12.1 */
#-o-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
*,
*:before,
*:after {
box-sizing: inherit;
}
::-webkit-scrollbar {
width: 0px; /* remove scrollbar space */
background: transparent; /* optional: just make scrollbar invisible */
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5em;
color: #545454;
position: relative;
margin: 0;
padding-bottom: 6rem;
min-height: 100%;
font-family: "Helvetica Neue", Arial, sans-serif;
}
#footer{
max-height: 0%;
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 1.5rem;
color: white;
background-color: #333333;
text-align: center;
}
#rights{
position: inherit;
bottom: -6px;
right: 0;
left: 0;
direction: rtl;
}
#creator{
position: inherit;
bottom: -2px;
font-size: 12px;
right: 10px;
direction: rtl;
}
#bottom{
direction: rtl;
word-wrap: break-word;
width: 350px;
}
#startingimage{
background: url("http://cwsmgmt.corsair.com/media/Blogs/how-to-build-a-pc/Motherboard-Selection/mobo.jpg");
background-size: cover;
background-position: center center;
text-align: center;
}
#welcome-message-box{
-webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */
-moz-animation: fadein 2s; /* Firefox < 16 */
-ms-animation: fadein 2s; /* Internet Explorer */
-o-animation: fadein 2s; /* Opera < 12.1 */
animation: fadein 2s;
max-width: 600px;
margin-left: auto;
margin-right: auto;
padding: 20px;
border-radius: 10px;
background: rgba(0,0,0,.7);
display: block;
z-index: 2;
}
#welcome {
top: 0; right: 0; bottom: 0; left: 0;
height: 100vh;
width: 100%;
background: url("http://i.imgur.com/fmKShVl.jpg");
background-size: cover;
background-position: center center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
background-attachment: fixed;
position: relative;
}
table a:link {
color: #666;
font-weight: bold;
text-decoration:none;
}
table a:visited {
color: #999999;
font-weight:bold;
text-decoration:none;
}
table a:active,
table a:hover {
color: #bd5a35;
text-decoration:underline;
}
table {
font-family:Arial, Helvetica, sans-serif;
color:#666;
font-size:12px;
text-shadow: 1px 1px 0px #fff;
background:#eaebec;
margin:0px;
border:#eaebec 1px solid;
-moz-border-radius:2px;
-webkit-border-radius:2px;
border-radius:2px;
/*
-moz-box-shadow: 0 1px 2px #d1d1d1;
-webkit-box-shadow: 0 1px 2px #d1d1d1;
box-shadow: 0 1px 2px #d1d1d1;
*/
}
table span{ text-shadow: 0px 0px 0px 0px #000;}
table th {
padding:21px 25px 22px 25px;
border-top:1px solid #fafafa;
border-bottom:1px solid #e0e0e0;
background: #fafafa;
}
table th:first-child{
text-align: center;
padding-left:20px;
}
table tr:first-child th:first-child{
-moz-border-radius-topleft:3px;
-webkit-border-top-left-radius:3px;
border-top-left-radius:3px;
}
table tr:first-child th:last-child{
-moz-border-radius-topright:3px;
-webkit-border-top-right-radius:3px;
border-top-right-radius:3px;
}
table tr{
text-align: right;
padding-left:20px;
}
table tr td:first-child{
text-align: center;
padding-left:20px;
border-left: 0;
}
table tr td {
padding:18px;
border-top: 1px solid #ffffff;
border-bottom:1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
background: #fafafa;
}
table tr.even td{
background: #fafafa;
}
table tr:last-child td{
border-bottom:0;
}
table tr:last-child td:first-child{
-moz-border-radius-bottomleft:3px;
-webkit-border-bottom-left-radius:3px;
border-bottom-left-radius:3px;
}
table tr:last-child td:last-child{
-moz-border-radius-bottomright:3px;
-webkit-border-bottom-right-radius:3px;
border-bottom-right-radius:3px;
}
table tr:hover td{
background: #f2f2f2;
cursor: pointer;
}
#spanInfo{
max-width: 310px;
margin-right:22px;
font-weight: lighter;
font-weight:normal;
text-align: right;
direction: rtl;}
.myButton {
background-color:#6b6b6b;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
border:1px solid #6b6b6b;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:13px;
padding: 10px 90px;
text-decoration:none;
}
.myButton:hover {
background-color:#3d3d3d;
}
.myButtonwhite {
background-color:#ffffff;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:10px;
border:1px solid #ffffff;
display:inline-block;
cursor:pointer;
color:#333;
font-family:Arial;
font-size:17px;
padding: 13px 20px;
}
.myButtonwhite:hover {
background-color:#333;
color: white;
border:1px solid #333;
}
/*
.myButton:active {
position:relative;
top:1px;
}
*/
input[type=range] {
-webkit-appearance: none;
width: 100%;
margin: -0.5px 0;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 37px;
cursor: pointer;
-webkit-box-shadow: inset 0px 1px 2px 1px rgba(0,0,0,0.1);
-moz-box-shadow: inset 0px 1px 2px 1px rgba(0,0,0,0.1);
box-shadow: inset 0px 1px 2px 1px rgba(0,0,0,0.1);
background: #f5f5f5;
border-radius: 0px;
border: 0px solid #010101;
}
input[type=range]::-webkit-slider-thumb {
/* box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;*/
border: 0px solid #f5f5f5;
height: 37px;
width: 15px;
border-radius: 0px;
background: #6b6b6b;
cursor: pointer;
-webkit-appearance: none;
margin-top: 0px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #f5f5f5;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 37px;
cursor: pointer;
/* box-shadow: 0.2px 0.2px 0px #000000, 0px 0px 0.2px #0d0d0d;*/
background: #f5f5f5;
border-radius: 0px;
border: 0px solid #010101;
}
input[type=range]::-moz-range-thumb {
/* box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;*/
border: 0px solid #f5f5f5;
height: 36px;
width: 15px;
border-radius: 0px;
background: #6b6b6b;
cursor: pointer;
}
input[type=range]::-ms-track {
width: 100%;
height: 37px;
cursor: pointer;
background: transparent;
border-color: transparent;html {
background-color: #e6e9e9;
background-image: -webkit-linear-gradient(270deg,rgb(230,233,233) 0%,rgb(216,221,221) 100%);
background-image: linear-gradient(270deg,rgb(230,233,233) 0%,rgb(216,221,221) 100%);
-webkit-font-smoothing: antialiased;
}
body {
margin: 0 auto;
padding: 2em 2em 4em;
max-width: 800px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5em;
color: #545454;
}
/*
h1, h2, h3, h4, h5, h6 {
color: #222;
font-weight: 600;
line-height: 1.3em;
}
h2 {
margin-top: 1.3em;
}
a {
color: #0083e8;
}
b, strong {
font-weight: 600;
}
samp {
display: none;
}
img {
-webkit-animation: colorize 2s cubic-bezier(0, 0, .78, .36) 1;
animation: colorize 2s cubic-bezier(0, 0, .78, .36) 1;
background: transparent;
border: 10px solid rgba(0, 0, 0, 0.12);
border-radius: 4px;
display: block;
margin: 1.3em auto;
max-width: 95%;
}
#-webkit-keyframes colorize {
0% {
-webkit-filter: grayscale(100%);
}
100% {
-webkit-filter: grayscale(0%);
}
}
#keyframes colorize {
0% {
filter: grayscale(100%);
}
100% {
filter: grayscale(0%);
}
}
*/
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #e8e8e8;
border: 0px solid #010101;
border-radius: 0px;
/* box-shadow: 0.2px 0.2px 0px #000000, 0px 0px 0.2px #0d0d0d;*/
}
input[type=range]::-ms-fill-upper {
background: #f5f5f5;
border: 0px solid #010101;
border-radius: 0px;
/* box-shadow: 0.2px 0.2px 0px #000000, 0px 0px 0.2px #0d0d0d;*/
}
input[type=range]::-ms-thumb {
/* box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;*/
border: 0px solid #f5f5f5;
width: 15px;
border-radius: 0px;
background: #6b6b6b;
cursor: pointer;
height: 36px;
}
input[type=range]:focus::-ms-fill-lower {
background: #f5f5f5;
}
input[type=range]:focus::-ms-fill-upper {
background: #ffffff;
}
}
span {display: none;position: absolute; font-weight: normal;}
a span {display: none; position: relative; color: #000; background: #fff; width: 350px; height: auto;font-weight: normal;}
a {position: relative;font-weight: normal;}
a:hover span {position:absolute;bottom:-70; display: block;z-index: 9999; -webkit-box-shadow: 0px 5px 14px -1px rgba(0,0,0,0.25); -moz-box-shadow: 0px 5px 14px -1px rgba(0,0,0,0.25); box-shadow: 0px 5px 14px -1px rgba(0,0,0,0.25); display: block;text-align:center;font-weight: normal; right:0; }
a:hover span:after{
content: "";
position: absolute;
width: 0;
height: 0;
margin-left: -0.5em;
top:0.5%;
right: 5%;
box-sizing: border-box;
border: 7px solid black;
border-color: transparent transparent #ffffff #ffffff;
transform-origin: 0 0;
transform: rotate(135deg);
-webkit-box-shadow: -3px 3px 5px 0 rgba(0, 0, 0, 0.08);
-moz-box-shadow: -3px 3px 5px 0 rgba(0, 0, 0, 0.08);
box-shadow: -3px 3px 5px 0 rgba(0, 0, 0, 0.08);
}
#-moz-keyframes bounce {
0%, 20%, 50%, 80%, 100% {
-moz-transform: translateY(0);
transform: translateY(0);
}
40% {
-moz-transform: translateY(-30px);
transform: translateY(-30px);
}
60% {
-moz-transform: translateY(-15px);
transform: translateY(-15px);
}
}
#-webkit-keyframes bounce {
0%, 20%, 50%, 80%, 100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
40% {
-webkit-transform: translateY(-30px);
transform: translateY(-30px);
}
60% {
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
}
#keyframes bounce {
0%, 20%, 50%, 80%, 100% {
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-webkit-transform: translateY(0);
transform: translateY(0);
}
40% {
-moz-transform: translateY(-30px);
-ms-transform: translateY(-30px);
-webkit-transform: translateY(-30px);
transform: translateY(-30px);
}
60% {
-moz-transform: translateY(-15px);
-ms-transform: translateY(-15px);
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
}
.arrow {
position: absolute;
bottom: 0;
right: 49.25%;
width: 35px;
height: 35px;
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0yOTMuNzUxLDQ1NS44NjhjLTIwLjE4MSwyMC4xNzktNTMuMTY1LDE5LjkxMy03My42NzMtMC41OTVsMCwwYy0yMC41MDgtMjAuNTA4LTIwLjc3My01My40OTMtMC41OTQtNzMuNjcyICBsMTg5Ljk5OS0xOTBjMjAuMTc4LTIwLjE3OCw1My4xNjQtMTkuOTEzLDczLjY3MiwwLjU5NWwwLDBjMjAuNTA4LDIwLjUwOSwyMC43NzIsNTMuNDkyLDAuNTk1LDczLjY3MUwyOTMuNzUxLDQ1NS44Njh6Ii8+DQo8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNMjIwLjI0OSw0NTUuODY4YzIwLjE4LDIwLjE3OSw1My4xNjQsMTkuOTEzLDczLjY3Mi0wLjU5NWwwLDBjMjAuNTA5LTIwLjUwOCwyMC43NzQtNTMuNDkzLDAuNTk2LTczLjY3MiAgbC0xOTAtMTkwYy0yMC4xNzgtMjAuMTc4LTUzLjE2NC0xOS45MTMtNzMuNjcxLDAuNTk1bDAsMGMtMjAuNTA4LDIwLjUwOS0yMC43NzIsNTMuNDkyLTAuNTk1LDczLjY3MUwyMjAuMjQ5LDQ1NS44Njh6Ii8+DQo8L3N2Zz4=);
background-size: contain;
}
.bounce {
-moz-animation: bounce 3s infinite;
-webkit-animation: bounce 3s infinite;
animation: bounce 3s infinite;
}
#choices{
max-width: 800px ;
position: relative;
text-align:center;margin:auto;
}
#choices2{
max-width: 800px ;
position: relative;
text-align:center;margin:auto;
}
#ChoiceButton {
background-color:#6b6b6b;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
border:1px solid #6b6b6b;
display:inline-block;
cursor:pointer;
color:#A2A2A2;
font-family:Arial;
font-size:13px;
padding: 10px 20px;
text-decoration:none;
}
#windowsAdd {
background-color:#6b6b6b;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
border:1px solid #6b6b6b;
display:inline-block;
cursor:pointer;
color:white;
font-family:Arial;
font-size:13px;
padding: 10px 20px;
text-decoration:none;
}
#dvdburner {
background-color:#6b6b6b;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
border:1px solid #6b6b6b;
display:inline-block;
cursor:pointer;
color:white;
font-family:Arial;
font-size:13px;
padding: 10px 20px;
text-decoration:none;
}
#dvdburner:hover{
background-color:#3d3d3d;
}
#windowsAdd:hover{
background-color:#3d3d3d;
}
#ChoiceButton:hover {
background-color:#3d3d3d;
}
button:focus {outline:0 !important;}
#popup{
background:#F8F8F8;
border: 5px solid #DFDFDF;
color: #717171;
font-size: 13px;
height: 30px;
letter-spacing: 1px;
line-height: 30px;
position: relative;
text-align: center;
text-transform: uppercase;
top: -80px;
left:-30px;
display:none;
}
#popup:after{
content:'';
position:absolute;
bottom:-10px;
z-index: 5;
border-bottom:5px solid #dfdfdf;
border-right:5px solid #dfdfdf;
background:#f8f8f8;
left:50%;
margin-left:-10px;
-moz-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
transform:rotate(45deg);
}
#btn1:hover #popup{
display:block;
}
#logo{
display: block;
margin-left: auto;
margin-right: auto;
}
.alert{
background-color:
rgb(252, 248, 227);
border-bottom-color:
rgb(138, 109, 59);
border-bottom-left-radius:
4px;
border-bottom-right-radius:
4px;
border-bottom-style:
none;
border-bottom-width:
0px;
border-image-outset:
0px;
border-image-repeat:
stretch;
border-image-slice:
100%;
border-image-source:
none;
border-image-width:
1;
border-left-color:
rgb(138, 109, 59);
border-left-style:
none;
border-left-width:
0px;
border-right-color:
rgb(138, 109, 59);
border-right-style:
none;
border-right-width:
0px;
border-top-color:
rgb(138, 109, 59);
border-top-left-radius:
4px;
border-top-right-radius:
4px;
border-top-style:
none;
border-top-width:
0px;
box-sizing:
border-box;
color:
rgb(138, 109, 59);
display:
block;
font-family:
'Source Sans Pro', Calibri, Candara, Arial, sans-serif;
font-size:
15px;
height:
51px;
line-height:
21.4286px;
margin-bottom:
20px;
padding-bottom:
15px;
padding-left:
15px;
padding-right:
15px;
padding-top:
15px;
text-align:
center;
text-shadow:
none;
width: 800px;
position: relative;
left:0;
right:0;
margin-bottom: -20px;
margin-top: -5px;
height: auto;
display: none;
border:1px solid #F7E5C6;
direction: rtl;
}
https://jsfiddle.net/gLxefxbf/2/
If you enter this jsfiddle from chrome the gray div next to the slider will be at the same height as the slider. but if you enter from Firefox the div will be positioned slightly higher. I really don't know what is causing that problem, Thanks for the help!
Whenever trying to style something I would always recommend trying to use a % marker instead of pixels, as different devices or browsers can display things in different ways;
<div id="content" style=" max-width: 800px; margin-left:auto;margin-right:auto; position:relative;">
Change to something like
<div id="content" style=" max-width: 50%; margin-left:auto;margin-right:auto; position:relative;">
If you wanted a blank space on the right simply create another div that would allow for that.
Hope that helps.

Trying to a fix a broken UL border

I need your help. For some reason, I cannot seem to get my border to seamlessly line up with its parent element. The example below depicts the problem that I am having:
Here is a drawing of the desired result:
I am guessing that I cannot be that far off. Maybe a fresh set eyes can remedy the issue at hand.
Here is the HTML & CSS in question:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
* {
font-family: Segoe UI;
font-size: 9pt;
}
.dropdown dd, .dropdown ul {
margin: 0px;
padding: 0px;
}
.dropdown dd {
position: relative;
}
.dropdown:hover {
color:#5d4617;
}
.dropdown dt {
border:1px solid rgb(180,180,180);
width: 170px;
position: relative;
border-radius: 2px;
padding: 1px;
}
.dropdown dt:hover, .dropdown dt:focus {
color:#5d4617;
border-color: rgb(180,180,180);
}
.dropdown dt input[type=text] {
border: 0;
width: 100%;
box-sizing: border-box;
}
.dropdown dt input[type=button] {
border: 0;
width: 15px;
height: 18px;
margin: 0;
padding: 0;
position: absolute;
top: 0;
right: 0;
}
.dropdown dd ul {
border-left:1px solid rgb(180,180,180);
border-right:1px solid rgb(180,180,180);
border-bottom:1px solid rgb(180,180,180);
border-top:1px solid #FFF;
color: #000;
display: block;
left: 0px;
top: -1px;
padding: 1px;
position:absolute;
width:auto;
min-width: 170px;
list-style:none;
cursor: pointer;
}
.dropdown dd ul li {
padding: 2px;
display: block;
}
.dropdown dd ul li:hover {
background-color: rgb(232,232,232);
font-weight: bold;
}
#field_img {
position:absolute;
left:0px;
top:2px;
}
#fileno {
padding-left: 18px;
}
/*CSS STYLING FOR BUTTONS */
input[type="button"] {
cursor:pointer;
border: 1px solid #707070;
background-color: #F0F0F0;
border-radius: 4px;
box-shadow: inset 0 1px 2px #fff, inset 0 -0.7em #DDD;
background-image: -ms-linear-gradient(top, #F1F1F1 0%, #E3E3E3 50%, #D0D0D0 100%);
padding: 3px 6px;
}
input[type="button"]:hover {
cursor:pointer;
background-color: #EAF6FD;
border: 1px solid #3C7FB1;
box-shadow: inset 0 1px 2px #fff, inset 0 -0.7em #BEE6FD, 0 0 3px #A7D9F5;
}
input[type="button"][disabled], input[type="button"][disabled]:hover {
border: 1px solid #ADB2B5;
text-shadow: 1px 1px #fff;
cursor:default;
background-color: #F4F4F4;
box-shadow: inset 0 1px 2px #fff;
}
</style>
</head>
<body>
<div style="float: left;" class="dropdown">
<dt>
<img src="glass.png" id="field_img">
<input id="fileno" type="text">
<input type="button" value="▼" id="btn_arrow">
</dt>
<dd>
<ul id="recent"></ul>
</dd>
</div>
<div><input type="button" id="search" value="search"></div>
</body>
</html>
.dropdown dt {
border:1px solid rgb(180, 180, 180);
border-bottom: 0; /* << ------------------------ fix here */
...
}
.dropdown dd ul {
border-left:1px solid rgb(180, 180, 180);
border-right:1px solid rgb(180, 180, 180);
border-bottom:1px solid rgb(180, 180, 180);
border-top: 0; /* << ------------------------ fix here */
...
}
Demo

css - div background color not showing

I am trying to make the background color of the div: content2 the same as that of div: sidebar. However the background color does not show for content2 but it does for sidebar.
Also i am trying to make the header and footer bars transparent but it does not seem to work.
This is my css code
body {
background-image: url('background.jpg');
background-size: 100% 100%;
padding: 0px 0px 0px 0px;
font-size: 13px;
position: relative;
min-height: 400px;
}
#footer {
float: left;
height: 20px;
width: 100%;
border: 1px solid black;
text-align: center;
padding: 30px 0px 20px 0px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
position:relative;
z-index:999;
//transparency
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */
}
#content2 { //sign in page
background-color: #EEE;
float: left;
margin: 38px 20px 38px 200px;
height: 370px;
width: 550px;
border: 1px solid black;
padding: 15px;
padding-top: 20px;
font-size: 18px;
}
#sidebar {
background-color: #EEE;
float: left;
margin: 38px 200px 38px 20px;
height: 300px;
width: 250px;
border: 1px solid black;
padding: 15px;
}
#menucontainer{
width: 79.5%;
text-align: center;
margin: 0px 0px 0px 0px;
padding: 6px 6px 4px 270px;
height: 60px;
line-height: 25px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
z-index:999;
}
#menu-bar {
width: 624px;
margin-left: auto;
margin-right: auto;
height: 395px;
}
And this is my html code
<div id="menucontainer">
<ul id="menu-bar">
menu
</ul>
</div>
<div id="content2">
content 2
</div>
<div id="sidebar">
side bar
</div>
<div id="footer">
footer
</div>
</body>
Can anyone please help me with this? Thanks
It's because you used the // to comment a single line in CSS. You can just use the pair /* and */ to comment in CSS. So all the following CSS is discarded. Check this Demo
replace comment "//sign in page" with "/*sign in page */" .
add opacity in header and footer div #footer and #menucontainer
#menucontainer {
opacity: 0.5;
}
or change in background style code like this
#menucontainer {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(169, 169, 169, 0.8)), to(rgba(124, 124, 124, 0.8)));
background: -moz-linear-gradient(top, rgba(169, 169, 169, 0.8), rgba(124, 124, 124, 0.8) ); }
and for background in content 2 add background property in class #content2
#content2 {
float: left;
margin: 38px 20px 38px 200px;
height: 370px;
width: 550px;
border: 1px solid black;
padding: 15px;
padding-top: 20px;
font-size: 18px;
background: #ccc;
}
and delete those things from your code
//transparency
//sign in page
the // is valid only if you are writing and .scss file (sass), that's usually the comment syntax for javascript also.
the standard css comment syntax is /* your comment here */
It is working correctly.
But the thing is comments inside style tag should be done through this fashion /* -- */
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
background-image: url('background.jpg');
background-size: 100% 100%;
padding: 0px 0px 0px 0px;
font-size: 13px;
position: relative;
min-height: 400px;
}
#footer {
float: left;
height: 20px;
width: 100%;
border: 1px solid black;
text-align: center;
padding: 30px 0px 20px 0px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
position:relative;
z-index:999;
/*transparency*/
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */
}
#content2 {
background-color: #EEE;
float: left;
margin: 38px 20px 38px 200px;
height: 370px;
width: 550px;
border: 1px solid black;
padding: 15px;
padding-top: 20px;
font-size: 18px;
}
#sidebar {
background-color: #EEE;
float: left;
margin: 38px 200px 38px 20px;
height: 300px;
width: 250px;
border: 1px solid black;
padding: 15px;
}
#menucontainer{
width: 79.5%;
text-align: center;
margin: 0px 0px 0px 0px;
padding: 6px 6px 4px 270px;
height: 60px;
line-height: 25px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
z-index:999;
}
#menu-bar {
width: 624px;
margin-left: auto;
margin-right: auto;
height: 395px;
}
</style>
</head>
<body>
<div id="menucontainer">
<ul id="menu-bar">
menu
</ul>
</div>
<div id="content2">
content 2
</div>
<div id="sidebar">
side bar
</div>
<div id="footer">
footer
</div>
</body>
</html>
JS Fiddle:
http://jsfiddle.net/zRS84/