I have the following css:
.horizontal-holder1{
float:left;
width:88px;
height:98px;
margin-bottom:15px;
border:1px solid #bdbdbd;
background-color:grey;
}
.white-holder{
width:88px;
height:49px;
background-color:white;
float:left;
.yellow-holder{
width:88px;
height:49px;
background-color:#FFF8DC;
float:left;
}
.player-holder{
width:60px;
height:49px;
float:left;
}
.score-holder{
width:28px;
height:49px;
float:left;
}
And the following html:
<div class="horizontal-holder1">
<div class="white-holder">
<div class="player-holder">
<? echo $data['username']; ?>
</div>
<div class="score-holder">
0
<div>
</div>
<div class="yellow-holder">
<div class="player-holder">
<? echo $data['username']; ?>
</div>
<div class="score-holder">
0
<div>
</div>
</div>
The problem is that the yellow holder doesn't float below the white holder, it goes to the right.
Can anyone see a reason for this?
Thanks
possible issue with the syntax on "score-holder"
<div class="score-holder">
0
<div>
the closing <div> tag has no end-tag slash (/)
looks okay once the end-tags are fixed: jsfiddle example
Properly close the .score-holder
It's a good practise to name your classes by their purpose not appearance (.yellow-holder .second-team-holder).
Why do you put float:left everywhere?
Add } after .yellow-holder CSS definition
You're missing a / in some of your closing tags, and a } in your CSS.
<div class="horizontal-holder1">
<div class="white-holder">
<div class="player-holder">
<? echo $data['username']; ?>
</div>
<div class="score-holder">
0
</div> <!-- here -->
</div>
<div class="yellow-holder">
<div class="player-holder">
<? echo $data['username']; ?>
</div>
<div class="score-holder">
0
</div> <!-- and here! -->
</div>
</div>
.horizontal-holder1{
float:left;
width:88px;
height:98px;
margin-bottom:15px;
border:1px solid #bdbdbd;
background-color:grey;
}
.white-holder{
width:88px;
height:49px;
background-color:white;
float:left;
} /* whoops! */
.yellow-holder{
width:88px;
height:49px;
background-color:#FFF8DC;
float:left;
}
.player-holder{
width:60px;
height:49px;
float:left;
}
.score-holder{
width:28px;
height:49px;
float:left;
}
All fixed: http://cssdesk.com/LT5tL
Related
I am self-taught in HTML and CSS, but one problem I have recently been running into is modifying links with CSS. I have done it in the past before, many times with no error, but now all the ways I can think of and that I find on the internet do nothing.
I have tried all of these ways, and none worked:
a.linkclass:link{text-decoration:none;}
.linkclass a:link{text-decoration:none;}
#linkid a:link{text-decoration:none;}
a#linkid:link{text-decoration:none;}
{note, these were not done all at the same time, just examples}
My HTML and CSS are as follows(after looking over and over, I could find nothing wrong that could cause these problems)
body{
margin:0;
background-color:eaf7ff;
}
#menubar{
max-height:10%;
min-height:3%
height:5%;
background-color:BBBBBB;
border-bottom:1px solid black;
max-width:100%;
min-width:100%;
width:100%;
float:left;
position:fixed;
display:inline-block
}
#pushbox{
max-height:10%;
height:10%;
background-color:black;
max-width:100%;
min-width:100%;
width:100%;
}
#box1{
background-color:eaf7ff;
}
#tag1{
background-color:eaf7ff;
margin:0;
}
#box2{
background-color:fff7ea;
}
#tag2{
background-color:eaf7ff;
margin:0;
}
#box3{
background-color:eaf7ff;
}
#tag3{
background-color:eaf7ff;
}
#box4{
background-color:fff7ea;
}
#tag4{
background-color:eaf7ff;
}
#box5{
background-color:eaf7ff;
}
#tag5{
background-color:eaf7ff;
}
#copyright{
}
.content{
max-width:100%;
min-width:100%;
width:100%;
min-height:80%;
height:85%;
}
.contenttag{
max-height:10%;
height:10%;
max-width:100%;
min-width:100%;
width:100%;
}
a.menulink{
border:1px solid black;
background-color:red;
}
a:link {
text-decoration: none;
color:black;
}
a:visited {
text-decoration: none;
color:black;
}
a:hover {
text-decoration: none;
color:black;
}
a:active {
text-decoration: none;
color:black;
}
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<!-- ==========MENUBAR==========-->
<div id='menubar'>
<h1>
<a href='#tag1' class='menulink'>OPT1</a>
<a href='#tag2' class='menulink'>OPT2</a>
<a href='#tag3' class='menulink'>OPT3</a>
<a href='#tag4' class='menulink'>OPT4</a>
<a href='#tag5' class='menulink'>OPT5</a>
</h1>
</div>
<!-- ==========CONTENTBOX1==========-->
<div id='tag1' class='contenttag'></div>
<div id='box1' class='content'>
<h1>ContentBox1</h1>
</div>
<!-- ==========CONTENTBOX2==========-->
<div id='tag2' class='contenttag'></div>
<div id='box2' class='content'>
<h1>ContentBox2</h1>
</div>
<!-- ==========CONTENTBOX3==========-->
<div id='tag3' class='contenttag'></div>
<div id='box3' class='content'>
<h1>ContentBox3</h1>
</div>
<!-- ==========CONTENTBOX4==========-->
<div id='tag4' class='contenttag'></div>
<div id='box4' class='content'>
<h1>ContentBox4</h1>
</div>
<!-- ==========CONTENTBOX5==========-->
<div id='tag5' class='contenttag'></div>
<div id='box5' class='content'>
<h1>ContentBox5</h1>
</div>
<!-- ==========COPYRIGHT==========-->
<div id='copyright'><center>
copyright © Vladimir Plenskiy <?php echo date("Y"); ?>, Template by Timothy Leitzke
</center>
</div>
</body>
</html>
The 'a.menulink' by itself did not work. (Sorry if this is confusing, it is currently 12:14 AM and I have also been working on a project in Unity and some art on my computer for the past 24+ hours)
--edit--
for those who do not understand what my problem is, even though the format is right. The CSS styling using classes and ids does not work(the examples that I tried are all at the first CSS stylesheet. that style sheet is not one used on the page, as seen in the header, only ONE is used)
According your HTML proper CSS for your links should be:
.menulink:link {text-decoration:none;}
This is how my website looks in Google Chrome and nearly all browsers except some versions of IE.
This is how it looks in IE8, IE9 and probably in IE6.
The funny thing is that the website looks ABSOLUTELY ok in IE7. I want you to help me solve the problem, but I don't really know which data to server you, but if you ask, I can provide everything you need.
Here's the header code:
<div id="header">
<div id="headercont">
<div id="headerlogo">
<img src="<?php echo dir;?>css/images/headerbg.png" class="header" />
</div>
<div id="menu">
<div id="mpointshighlight">
<div id="menupoints">
<?php echo menuSpace; ?>
<div id="menumain">Main</div>
<?php echo menuSpace; ?>
<div id="menuabout">About</div>
<?php echo menuSpace; ?>
<div id="menublog">Blog</div>
<?php echo menuSpace; ?>
<div id="menuphotos">Photos</div>
<?php echo menuSpace; ?>
<div id="menuvideos">Videos</div>
<?php echo menuSpace; ?>
<div id="menumusic">Music</div>
<?php echo menuSpace; ?>
<div id="menuprojects">Projects</div>
</div>
</div>
</div>
</div>
</div>
Here's the header CSS:
#header {
background-color:#00a2ff;
background-image:url('images/menubg.png');
background-repeat:repeat-x;
background-position:bottom;
width:100%;
min-width:1100px;
height:243px;
}
#headercont {
margin:auto;
width:1100px;
}
#headerlogo {
margin:auto;
width:1000px;
}
#menu {
width:100%;
height:44px;
}
#menupoints {
position:relative;
width:1000px;
font-size:24px;
font-family:verdana;
height:44px;
}
#mpointshighlight {
margin:auto;
width:1000px;
margin-bottom:10px;
background-repeat:no-repeat;
}
#menupoints a:link {
color:white;
text-decoration:none;
text-shadow: black 2px 2px 3px;
}
#menupoints a:visited {
color:white;
text-decoration:none;
text-shadow: gray 2px 2px 3px;
}
#menupoints a:hover {
color:white;
text-decoration:none;
text-shadow: black 2px 2px 3px, white 0 0 1em;
}
#menupoints a:active {
}
#menumain {
display:inline
}
#menuabout {
display:inline
}
#menublog {
display:inline
}
#menuphotos {
display:inline
}
#menuvideos {
display:inline
}
#menumusic {
display:inline
}
#menuprojects {
display:inline
}
Hard to be certain what the problem is without going into depth, but something that might help is to look into compatibility modes in IE:
http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx
Specifically, tell IE8 and higher to emulate IE7:
Ensure this is the first HTML tag in the head.
As for IE6, depending on your target audience, you might be able to get away with ignoring it, otherwise it's a trawl through CSS I'm afraid!
I'm having problems with this site I am building. I need a fixed width so that I can do margin-left and margin-right auto (center the form item on my 'left window'. Problem is that I'm trying to make this code modular so that it will work with any future forms I decide to create as well, meaning I need a variable height, depending on how many fields a form will need.
so to clarify the above statement, I'm trying to keep the fixed width and have a variable height (using min-height). The problem is that the background color and div border are not shrinking or expanding along with the div size. any ideas?
the site is here: http://traelid.com/news/createNews.php
here is my form code and my CSS code:
FORM:
<script type='text/javascript' src='../nicEdit/nicEdit.js'></script>
<script type='text/javascript'>
bkLib.onDomLoaded(function() {nicEditors.allTextAreas() });
</script>
<div class='frmcontainer'>
<div class='title'>TraeLid News</div>
<div class='fill'>
<div class='row'>
<div class='frm lbl'>
<label for='author'>Author:</label>
</div>
<div class='frm itm'>
Auto Author
</div>
</div>
<div class='row'>
<div class='frm lbl'>
<label for='subject'>Subject:</label>
</div>
<div class='frm itm'>
<input class='itm itmtxt' type='text' name='subject' />
</div>
</div>
<div class='row'>
<div class='frm lbl'>
<label for='content'>Content:</label>
</div>
<div class='frm itm txtarea' style='background-color:#fff;'>
<textarea class='itm itmtxtarea ckeditor' name='content'></textarea>
</div>
</div>
<div class='row'>
<div class='frm lbl'>
<label for='tags'>Tags:</label>
</div>
<div class='frm itm'>
<input class='itm itmtxt' type='text' name='tags' />
</div>
</div>
</div>
</div>
CSS:
.frmcontainer
{
text-align:center;
width:750px;
min-height:200px;
margin-left:auto;
margin-right:auto;
border-radius:10px;
border-width:1px;
border-style:solid;
}
.frm
{
margin:5px;
}
.title
{
clear:both;
width:750px;
margin-bottom:24px;
font-size:28px;
font-weight:bold;
text-decoration:underline;
font-variant:small-caps;
}
.row
{
width:750px;
height:auto;
float:left;
clear:both;
}
.lbl
{
font-size:18px;
font-weight:bold;
text-align:left;
height:30px;
width:150px;
float:left;
}
/*Container and input styles*/
.itm
{
text-align:left;
height:25px;
width:580px;
float:left;
}
.itmtxt
{
width:576px;
border-style:solid;
border-width:1px;
}
.txtarea
{
height:400px;
}
.itmtxtarea
{
width:578px;
height:343px;
border-style:solid;
border-width:1px;
}
.nicEdit-panel
{
background-color: #eee;
}
.nicEdit-selected
{
background-color: #fff;
word-wrap:break-word;;
overflow:hidden;
}
.nicEdit-main
{
word-wrap:break-word;
overflow:hidden;
max-height:343px;
}
on .frmcontainer add overflow: hidden;. fiddle ex
I'm totally lost, I just finished setting up my navigation bar and now i can't seem to show the settings icon and the main text in any other position than fixed... here is my code sample , it can't show images
This is the entire relevant code, the html, as well as the css.
The end result should be a navigationbar, similar to the one that facebook uses for "Groups".
HTML(php):
<div style='width:100%;max-height:31px;position:relative;top:1px;overflow:hidden;'>
<div style='width:2000px;max-height:31px;position:relative;overflow:hidden;'>
<div class='groups_navi-active' id='navbar-groupname'>
<div style='height:30px;float:left; width:11px;'>
</div>
<div style='height:30px;float:left;'>
".$navbar_groupname."
</div>
<div style='height:30px;float:left;width:11px;'>
</div>
</div>
<div class='groups_navi-inactive' id='navbar-structure'>
<div style='height:30px;float:left; width:11px;'>
</div>
<div style='height:30px;float:left;'>
Structure
</div>
<div style='height:30px;float:left;width:11px;'>
</div>
</div>
<div class='groups_navi-inactive' id='navbar-explore'>
<div style='height:30px;float:left; width:11px;'>
</div>
<div style='height:30px;float:left;'>
Explore!
</div>
<div style='height:30px;float:left;width:11px;'>
</div>
</div>
<div class='groups_navi-right'>
</div>
</div>
<div style='float:right;position:fixed;top:42px;height:22px;width:796px;z-index:1'>
<div class='groups_navi-settingsicon' id='groups_navi-settingsicon' ></div>
<div style='clear:both;'></div>
<!-- THIS IS HIDDEN AND WILL BE MADE VISIBLE WITH JAVASCRIPT !-->
<div id='navbar-settings-list' style='border-left:1px solid #787878;border-right:1px solid #787878;border-top:1px solid #787878;background-color:#ffffff;border-bottom:2px solid #283d6c;background color:#ffffff;float:right;display:none;z-index:5;'>
<div style='width:126px;height:4px;'></div>
<div class='groups-navi-settings-list_option-inactive' id='groups-navi-settings-list_option--deletegroup' title='".$_GET['groupid']."'>
Delete Group
</div>
<div style='width:126px;height:4px;'></div>
</div>
</div>
<div style='z-index:8;position:fixed;width:796px'>
<div>
<img src='IMG/texticon.png'>
</div>
<div>
".$groupoverview_groupdescription."
</div>
</div>
CSS:
.groups_navi-active
{
height:30px;position:relative;line-height:30px;
font-size:13px;
font-weight:bold;
color:#000000;
float:left;
z-index:2;
}
.groups_navi-inactive
{
float:left;
height:30px;
position:relative;
background-color:#f2f2f2;
border-bottom:1px solid #cccccc;
border-left:1px solid #dbdbdb;
border-right:0px;
border-top:0px;
line-height:30px;
font-size:11px;
font-weight:bold;
color:#818181;
z-index:2;
}
.groups_navi-right
{
float:left;
height:30px;
width:1000px;
position:relative;
background-color:#f2f2f2;
border-bottom:1px solid #cccccc;
border-left:1px solid #dbdbdb;
border-right:0px;
border-top:0px;
line-height:30px;
font-size:11px;
font-weight:bold;
color:#818181;
}
.groups_navi-settingsicon
{
width:31px;height:22px;background: url('../IMG/navbar-stgs.png');float:right;background-position: 0 0;
}
.groups_navi-settingsicon-active
{
width:31px;height:22px;background: url('../IMG/navbar-stgs.png');float:right;background-position: 0 -22;
}
.groups-navi-settings-list_option-inactive
{
width:126px; height: 18px;text-align:center;line-height:18px;
border-top:1px solid #ffffff;
border-bottom:1px solid #ffffff;
}
.groups-navi-settings-list_option-inactive:hover
{
width:126px; height: 18px;text-align:center;line-height:18px;background-color:#6c83b6;color:#f8ffff;
border-top:1px solid #39579b;
border-bottom:1px solid #39579b;
cursor:pointer;
}
The container (parent div) of your settings icon is position:fixed. That will override your float:right. In fact, I see two instances of using position:fixed without setting the X/Y offsets, which really just doesn't work.
If that's not it... I think you'll have better answers if you can boil your code down to the problematic areas.
I think you sould check the images path , its must be correct
I had made sample of it on this url
http://jsfiddle.net/563Vx/
feel free to update this fiddle
I am just facing a problem,can not able to overcome(make be lack of proper identification of problem).The header of a web template is working well in 1280*800 but breaking in larger resolution monitors(1900*1440). The Header contains total three divs as bellows:
<div id="header">
<!--#LOGO#-->
<div id="logo">
<img src="<?php echo SITE_IMG?>shop-logo.png" alt="<?php echo SITE_NAME;?>">
</div>
<!--#HEADER NAVIGATION#-->
<div id="welcomeimg">
<img src="<?php echo SITE_IMG?>shop-willkommen.png" alt="">
</div>
</div> <!-- end header-->
And the css of the templates as follows:
#header {padding-bottom:0px; margin-bottom:0; background-color:#CCCCCC;background:url(../images/shop-header-bg.jpg);
background-repeat:no-repeat; height:100px;}
#logo
{
left:105px;
#left:-350px;
position:relative;
width:300px;
}
#welcomeimg
{
float:right;
position:relative;
right:126px;
width:380px;
#top:-100px;
height:97px;
}
The to div "logo" and "welconeimg" just breaking and getting out of the middle of the header(wraper).
It will be helpful for me,if ant one can solve the problem.
Thanks in advance.
Do you have a link you can show? I tried this, basically your example with the 3 divs having a special background color, that way you can see where they are going.
#header {
padding-bottom:0px;
margin-bottom:0;
#background-color:#CCCCCC;
background:url(../images/shop-header-bg.jpg);
background-repeat:no-repeat; height:100px;
background-color: red;
}
#logo
{
left:105px;
#left:-350px;
position:relative;
width:300px;
background-color:green;
}
#welcomeimg
{
float:right;
position:relative;
right:126px;
width:380px;
#top:-100px;
height:97px;
background-color: yellow;
}
">shop-logo.png" alt="">
shop-willkommen.png" alt="">