Irregular shaped frames/borders in html or css - html

I am fairly new to html and css and I have been tasked to create a layout with irregularly shaped borders as depicted here: frame pic
I removed all the other content. I currently have no clear handle on how to approach the white area with the triangular pointer pointing at the button.
(That shape will contain more content.)
What would you suggest?

One method would be to rotate a square div by 45 degrees and have two borders visible.
Using the snippet provided by #quid:
#arrow {
background: #ffffff;
border-top: 1px solid #dcdcdc;
border-left: 1px solid #dcdcdc;
position: absolute;
height: 30px;
width: 30px;
top: 0;
right: 20px;
margin-top: -16px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(45deg);
}

added the arrow from #Banderi
Here's a fiddle with this working: http://jsfiddle.net/frnm9ymo/7/
With this most recent edit I even matched the colors for you.
It's not the most elegant solution I'm sure, but it works. You just make the arrow image match the colors of the box then overlap the border by whatever the width of the border is. Inside the red box would be a png image with a transparent background. The most important thing to remember is the arrow div will be "absolute" positioned and it's parent div must be "relative" positioned.
CSS:
* {
font-family: arial;
}
#wrapper {
background: #c7dae7;
width: 400px;
nin-height: 400px;
display: block;
float: left;
}
#container {
margin: 20px;
display: block;
background: #f6f7fb;
border: 1px solid #dfe2eb;
}
#titlebar {
margin: 0;
padding: 15px 20px;
display: block;
background: #fff;
overflow: none;
min-height: 30px;
border-bottom: 1px solid #dfe2eb;
}
#contents {
margin: 0 0 -40px 0;
padding: 7px;
display: block;
}
#textwrap {
margin: 5px;
padding: 10px 20px;
display: block;
background: #ffffff;
border: 1px solid #dcdcdc;
position: relative;
-webkit-border-radius: 15px 5px 15px 5px;
-moz-border-radius: 15px 5px 15px 5px;
border-radius: 15px 5px 15px 5px;
}
textwrap p {
z-index: 100;
}
#enter {
float: right;
width: 80px;
padding: 7px;
background: #4992e6;
color: #fff;
font-weight: bold;
border: 0;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
#arrow {
background: #ffffff;
border-top: 1px solid #dcdcdc;
border-left: 1px solid #dcdcdc;
position: absolute;
height: 30px;
width: 30px;
top: 0;
right: 30px;
margin-top: -17px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(45deg);
z-index: 50;
}
HTML:
<div id="wrapper">
<div id="container">
<div id="titlebar">
text
<button id="enter">
ENTER
</button>
</div>
<div id="contents">
<div id="textwrap">
<div id="arrow">
</div>
<p>
VHS artisan forage cornhole echo park, PBR&B ugh lomo poutine readymade cray gastropub wolf YOLO. Ugh tattooed umami, brooklyn VHS chambray crucifix celiac fixie. Pabst ennui neutra, chia truffaut brunch microdosing chartreuse flexitarian heirloom typewriter. Bushwick tattooed four dollar toast ramps, lomo sartorial pabst bicycle rights. Viral brunch direct trade chartreuse. Vegan squid pinterest, umami sartorial intelligentsia truffaut vice freegan normcore beard venmo pour-over. Direct trade knausgaard master cleanse plaid, wayfarers kogi kombucha keffiyeh.
Mustache chicharrones meggings, kale chips distillery yuccie lumbersexual shabby chic beard master cleanse crucifix blue bottle pour-over venmo. Sustainable pabst cronut whatever kale chips cliche everyday carry kinfolk, fap chicharrones gluten-free meggings microdosing umami. Irony selvage jean shorts synth gastropub, roof party keytar. Franzen fixie lumbersexual, mustache church-key flannel synth everyday carry gluten-free chartreuse pitchfork shoreditch. Tumblr viral chillwave mlkshk paleo. Jean shorts swag meggings pabst distillery tote bag. Pour-over messenger bag PBR&B cold-pressed VHS.
</p>
</div>
</div>
</div>
</div>

Related

How do I align images inside of a container that contains a paragraph?

I have put the image inside of the paragraph tag itself and floated it right, however it moves it to the right but underlaps the container edge.
I have taken it out of the paragraph section as well and it still does the same. I have created containers as well for them. I want the image in the container with the paragraph. I have attached an image of the issue I am having as well as my css.
body {
background-image: url(../images/keyboard.jpeg);
background-repeat: no-repeat;
background-size: cover;
font-family: cursive;
}
/* GOOGLE FONTS*/
#import url('https://fonts.googleapis.com/css2?family=Cookie&family=Fuzzy+Bubbles&family=Jost:wght#700&display=swap');
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Cookie';
font-weight: 700;
}
/*ID Classes*/
#mainTitle {
color: #FFF;
font-size: 5em;
text-align: center;
text-shadow: 5px 5px 10px #17e85f;
text-decoration: underline solid;
font-family: fantasy;
}
#container {
border: 10px solid #FFF;
margin: auto;
margin-top: 10px;
padding: auto;
width: 50%;
}
#footer {
color: #FFF;
text-align: center;
border: 2px;
border-style: solid;
}
/* REUSABLE CLASSES*/
.navbar {
background-color: #0a861d;
border-radius: 30px;
text-align: center;
}
.navbar li {
display: inline-block;
list-style: none;
margin: 13px 20px;
text-align: center;
}
.navbar ul {
overflow: auto;
}
.navbar li a {
padding: 3px 3px;
text-decoration: none;
color: white;
}
.search {
float: right;
color: white;
padding: 12px 75px;
}
.navbar input {
border: 2px solid black;
border-radius: 14px;
padding: 3px 17px;
width: 129px;
}
/*SERVICES PAGE LIST*/
.servicelist ul {
line-height: 1.5em;
margin: 5px 0 15px;
padding: 0;
}
.servicelist li {
font-size: 50px;
font-weight: 500;
background-image: linear-gradient(to left, rgba(60, 154, 118, 0.91), #15c723);
color: transparent;
text-align: center;
background-clip: text;
-webkit-background-clip: text;
}
.center {
text-align: center;
}
.margin {
margin-top: 10px;
}
.scontainer {
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.box {
float: left;
width: 50%;
color: #ccc;
text-align: center;
height: 50%;
font-size: 50vmin;
font-family: helvetica;
}
/* SINGLE CLASSES*/
a:hover {
box-shadow: inset 100px 0 0 0 #54b3d6;
color: white;
}
h2 {
color: #FFF;
font-size: 2em;
text-align: center;
text-shadow: 5px 5px 10px #17e85f;
text-decoration: underline solid;
font-family: fantasy;
}
p {
color: #b8dae2;
font-family: 'Helvetica Neue', sans-serif;
font-size: 1.3em;
line-height: 24px;
margin: 10px 10px 24px;
padding: 30px;
text-align: justify;
border: 3px solid #FFF;
}
.service_styling {
color: #b8dae2;
font-family: 'Helvetica Neue', sans-serif;
font-size: 1.3em;
line-height: 24px;
margin: 10px 10px 24px;
padding: 30px;
text-align: justify;
border: 3px solid #FFF;
}
.imgcontainer {
width: auto;
height: auto;
border: 2px solid red;
float: inline-end;
}
.realImgContainer {
width: auto;
height: auto;
border: 2px solid red;
float: right;
}
img {
/* max-width: 50%; */
/* max-height: 50%; */
/* border: 5px solid #FFF; */
/* margin: auto; */
/* margin-top: 10px; */
/* padding: auto; */
/* width: 50%; */
}
/*
.imgHardware{
float: right;
}
.imgSoftware{
float: right;
}
.imgApp{
float: right;
}
.imgCabling{
float: right;
}
*/
<!-- NAV BAR-->
<nav class="navbar">
<ul>
<li>Home</li>
<li>Services</li>
<li>Locations</li>
<div class="search">
<input type="text" name="search" id="search" placeholder="Search this website">
</div>
</ul>
</nav>
<h1 id="mainTitle"> Services</h1>
<!-- MAIN SECTION-->
<section id="container">
<h2> Things We Do </h2>
<div class="servicelist margin">
<h2>Hardware</h2>
<div class="service_styling">
<span>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
<div><img class="realImgContainer" src="images/cpusocket.jpeg" alt="computer socket"></div>
</span>
</div>
<div style="clear:both"></div>
<h2>Software</h2>
<p> We provide the latest software for all kinds of fields. We work directly with vendors to get the best rate - we provide competitive rates and offer affordable and simple subscription solutions - we also carry full version software that is subscription-free.
<img class="imgSoftware" src="images/code.jpeg" alt="computer code"></p>
<h2>Application development</h2>
<p> We can create and deploy custom software for whatever task you need completed. Our seasoned developers specialize in C, C++ and Java. Allowing us to create versailte and flexible software. Our team will with work with you hand in hand to ensure you
get exactly what you need. We will also provide 24/7 maintenance as well as upgrades on all of our in house software.
<img class="imgApp" src="images/codedeveloper.jpeg" alt="someone coding"></p>
<h2>Enterprise cabling</h2>
<p> We have over 30 years of infrastructure cabling experience. We have in house techncians who can terminate and pull ethernet and fiber optic cabling. We use our own equipment and do all of our work in house - without the use of a third party. So we
can give you a fair price as well as a clean and concise debriefing of the exact work we will be doing and its core benefits.
<img class="imgCabling" src="images/switchandcable.jpeg" alt="switch and cable">
</p>
</ul>
</section>
<!-- SUB SECTION-->
<section>
</section>
<!-- FOOTER-->
<div id="footer">© 2050</div>

Changing <summary> icon background will not work

I am using the <summary> tag to create a basic drop down.
I have successfully styled it the way I want with an image of a plus sign as the background. However once the <details> tag has been expanded I cannot get the background image to change to a picture of a minus.
I have tried many different multiple variations. On another note does classic Edge actually support <summary>? Compatibility sites say it has been supported since v79 however of all the tutorials showing how to use it don't work in classic Edge.
Is there a way to not show the contents of the <summary> and <details> tags if the browser doesn't support them?
summary {
list-style-image: url(images/more.png);
width: 24px;
height: 24px;
margin-bottom: 5px;
}
summary::-webkit-details-marker {
background: url(images/more.png);
color: transparent;
width: 24px;
height: 24px;
margin-bottom: 10px;
}
summary:after {
list-style-image: url(images/minus.png);
}
summary::-webkit-details-marker:after {
background: url(images/minus.png);
list-style-image: url(images/minus.png);
color: transparent;
width: 24px;
height: 24px;
margin-bottom: 10px;
}
details[open] summary:after {
background: url(images/minus.png);
list-style-image: url(images/minus.png);
}
details::-webkit-details-marker[open] summary::-webkit-details-marker:after {
background: url(images/minus.png);
list-style-image: url(images/minus.png);
}
I have gone back and found a solution that seems to work in all browsers except classic Edge and IE.
Instead of using images I am creating a new marker using CSS only and then updating the contents of the "icon" using CSS.
summary {
cursor: pointer;
font: bold 1em Arial, Helvetica, sans-serif;
padding: 8px 0;
position: relative;
width: 100%;
list-style-image: none;
}
summary::-webkit-details-marker {
display: none
}
summary:after {
background: white;
border-radius: 50%;
content: "+";
border-color: #000000;
border-style: solid;
border-width: 2px;
color: #000000;
float: left;
font-size: 19px;
line-height: 24px;
vertical-align: middle;
margin: -5px 10px 0 0;
padding: 0;
text-align: center;
width: 24px;
height: 24px;
}
details[open] summary:after {
line-height: 22px;
content: "-";
}
<details>
<summary> Expand me</summary>
<br> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</details>
I hope you want something like this. if its only about a plus and minus sign , you can do this with CSS, no need of images , change the sign color in CSS as per your need
EDIT: Although I am not agree with Connexo's comment below, but in case if you want to use some other approach or the same thing and not the summary tag as he mentioned, There is one more pure CSS option available here, check the next 3 + signs, first one is with Summary tag, and next one with Input
summary {
list-style-image: url(images/more.png);
position: relative;
width: 24px;
height: 24px;
margin-bottom: 5px;
}
summary:after {position: absolute; content: ""; height: 2px; width: 15px; background-color: red; top: 50%; transform: translateY(-50%);}
summary:before {position: absolute; content: ""; height: 2px; width: 15px; background-color: red; top: 50%; transform: translateY(-50%) rotate(90deg);}
summary::-webkit-details-marker {
background: url(images/more.png);
color: transparent;
width: 24px;
height: 24px;
margin-bottom: 10px;
}
summary:after {
list-style-image: url(images/minus.png);
}
details[open] summary:before {
background: url(images/minus.png);
list-style-image: url(images/minus.png);
}
.collapsibles {margin-top: 100px;}
.collapsibles >div {
position: relative;
margin-bottom: 30px;
padding-left: 30px;
}
.collapsibles >div p {opacity: 0; height: 0;}
.collapsibles >div input {position: absolute; height: 20px; width: 20px; top: 0; left: 0; border: 0 !important; outline: none !important;
-webkit-appearance: none; cursor: pointer;}
.collapsibles >div input:after {position: absolute; content: ""; height: 2px; width: 15px; background-color: red; top: 50%; transform: translateY(-50%);}
.collapsibles >div input:before {position: absolute; content: ""; height: 2px; width: 15px; background-color: red; top: 50%; transform: translateY(-50%) rotate(90deg);}
.collapsibles >div input:checked + p{opacity: 1; height: auto;}
.collapsibles >div input:checked:before {
display: none;
}
<h2>With Summary Tag</h2>
<details>
<summary></summary>
<p>Summary Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p>
</details>
<div class="collapsibles">
<h2>Without Summary Tag</h2>
<div><input type="checkbox"><p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p></div>
<div><input type="checkbox"><p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p></div>
<div><input type="checkbox"><p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p></div>
</div>

How to center button with float:right [duplicate]

This question already has answers here:
CSS vertically align floating divs
(6 answers)
Closed 6 years ago.
I don't know much HTML and CSS but I was able to make a call out box.
The gap between text and button has too much gap. And I want the button to be centered between the top and bottom border. I would appreciate if someone could help.
Check out the screenshot
Here's the code
<html>
<head>
<style>
div#abc {
padding: 5px 2px 8px 5px;
border: 1px solid #dddddd;
border-radius: 10px;
line-height: 120%;
border-top:none;
}
img#def {
margin:1px 8px 2px 2px;
}
h1#ghi {
font-size:18px;
color:#7fbdcb;
margin:0px;
font-face:"Raleway";
}
img#ggg {
font-size:18px;
color:#7fbdcb;
margin:4px;
float:right;
background-color:blue;
}
.button {
background-color: #7fbdcb;
border: none;
color: white;
padding: 6px 10px;
text-align: center;
text-decoration: none;
font-size: 16px;
cursor: pointer;
float: right;
margin-top: 12px;
margin-right: 4px;
margin-left: 0px;
}
.button:hover {
background-color: #6ea5b1;
}
</style>
</head>
<body>
<div id="abc"><img id="def" src="http://www.goodisle.com/wp-content/uploads/2014/03/raise-1.jpg" style="width:60px; height:60px; float:left;"><button class="button">Submit</button>
<h1 id="ghi">Submit your email</h1>
<p style="size:5px;">Cliche scenester Wes Anderson, Etsy Vice mustache.Cliche scenester Wes Anderson, Etsy Vice mustache.</p>
</div>
</body>
</html>
You either need to adjust the margin-top accordingly, which is a hack.
* {margin: 0; padding: 0; list-style: none; box-sizing: border-box;}
.btn {padding: 5px; text-decoration: none; border: 1px solid #ccc; color: #333; margin: 5px;}
.position,
.hack-type {border: 1px solid #999; margin: 10px; padding: 10px;}
.hack-type .btn {float: right; margin-top: 22px;}
<div class="hack-type">
Hello
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur aut accusamus esse distinctio iusto omnis reiciendis numquam eaque sunt laudantium. Alias explicabo nihil consectetur qui nemo cumque, quisquam iusto laborum.</p>
</div>
And using positioning, you can perfectly place it:
* {margin: 0; padding: 0; list-style: none; box-sizing: border-box;}
.btn {padding: 5px; text-decoration: none; border: 1px solid #ccc; color: #333; margin: 5px;}
.position,
.hack-type {border: 1px solid #999; margin: 10px; padding: 10px;}
.hack-type .btn {float: right; margin-top: 22px;}
.position {position: relative; padding-right: 100px;}
.position .btn {position: absolute; right: 5px; top: 50%; transform: translate(0, -50%);}
<div class="position">
Hello
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur aut accusamus esse distinctio iusto omnis reiciendis numquam eaque sunt laudantium. Alias explicabo nihil consectetur qui nemo cumque, quisquam iusto laborum.</p>
</div>

Background color of div is not appearing

Check out this html . i want the background color of div - 'social' to appear but it is not appearing .. :(
i have tried both overflow: hidden and clear: both .. but none of them are working .. please help
#charset "utf-8";
/* CSS Document */
body {
border-top: solid 10px #ff6b39;
padding: 0;
margin: 0;
}
.wrap {
width: 940px;
margin: 0 auto;
}
header {
padding: 0;
margin: 0;
padding-top: .001em;
position: relative;
border-bottom: 2px solid #e5e5e5;
}
header h1 {
background: url(img/sprite.png) no-repeat 0 0;
background-position: 0px -51px;
width: 172px;
height: 25px;
text-indent: -9999px;
float: left;
margin-top: 25px;
}
header h1 a {
width: 172px;
height: 25px;
display: block;
}
header p {
margin-top: 26px;
float: left;
margin-left: 25px;
font-size: 14px;
font-family: "Myriad Pro";
color: rgb(123, 123, 123);
line-height: 1.786;
text-align: left;
}
header nav {
clear: both;
}
header nav ul {
padding: 0;
margin: 0;
position: absolute;
top: 25px;
right: 0;
}
header ul li {
list-style: none;
padding: 0 18px;
float: left;
border-right: 1px solid #e4e4e4;
}
header nav ul li:last-child {
border-right: none;
}
header nav ul li:last-child {
padding-right: 0px;
}
header ul li a {
text-decoration: none;
font-size: 20px;
font-family: "Georgia";
color: rgb(245, 103, 55);
font-style: italic;
line-height: 0.85;
text-align: right;
display: block;
}
.social {
clear: both;
position: relative;
margin: 0;
padding: 0;
background: #e5e5e5;
}
.social h2 {
font-size: 30px;
font-family: "Georgia";
color: rgb(0, 0, 0);
font-style: italic;
line-height: 1.4;
text-align: left;
font-weight: 100;
float: left;
}
.social ul {
padding: 0;
margin: 0;
position: absolute;
top: 25px;
right: 0;
}
.social ul li {
list-style: none;
float: left;
}
.social ul li a {
font: 0/0;
color: transparent;
background-color: transparent;
text-decoration: none;
display: inline-block;
padding-right: 10px;
background: url(img/sprite.png) no-repeat 0 0;
width: 41px;
height: 41px;
}
.social a.facebook {
background-position: 0px 0px;
}
.social a.vimeo {
background-position: -49px 0px;
}
.social a.lastfm {
background-position: -100px 0px;
}
.social a.linkedin {
background-position: -150px 0px;
}
.social a.dribble {
background-position: -200px 0px;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>mumbo website - PSD to HTML</title>
<link type="text/css" rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrap">
<header>
<h1>Mumbo logo</h1>
<p>Powered by Jeffrey Way Industries</p>
<nav>
<ul>
<li>about</li>
<li>portfolio</li>
<li>contact</li>
</ul>
</nav>
</header>
<div class="social">
<h2>Take a look at our work to see what we mean</h2>
<ul>
<li>facebook</li>
<li>vimeo</li>
<li>lastfm</li>
<li>linkedin</li>
<li>dribbble</li>
</ul>
</div> <!-- end of social -->
<div class="heroimage">
<img src="img/hero-image.png" alt="hero image">
</div>
<div class="maincontent">
<h2>Risus portacon vestibulum posuere</h2>
<p>Cray sustainable vegan post-ironic mixtape. 8-bit sustainable sed put a bird on it keytar fingerstache et, ennui street art proident wayfarers viral ethnic. Eu craft beer anim, keffiyeh chambray occaecat jean shorts hella selvage keytar butcher vice in. American apparel pour-over master cleanse, fingerstache etsy qui umami dreamcatcher twee.</p>
<ul class="bullet">
<li>Cray sustainable vegan</li>
<li>Chambray occaecat jean shorts</li>
<li>Hella selvage</li>
<li>Over master cleanse</li>
</ul>
</div><!-- end of maincontent -->
<div class="blogspots">
<h2>Take a look at our work to see what we mean</h2>
<div id="sixposts">
<div class="post">
<img src="img/thumb1.png" alt="thumb1">
<h3>Purus Egestas Fusce</h3>
<p>Cras justo odio, dapibus ac facilisis egestas eget quam.</p>
</div>
<div class="post">
<img src="img/thumb2.png" alt="thumb1">
<h3>Purus Egestas Fusce</h3>
<p>Cras justo odio, dapibus ac facilisis egestas eget quam.</p>
</div>
<div class="post">
<img src="img/thumb3.png" alt="thumb1">
<h3>Purus Egestas Fusce</h3>
<p>Cras justo odio, dapibus ac facilisis egestas eget quam.</p>
</div>
<div class="post">
<img src="img/thumb4.png" alt="thumb1">
<h3>Purus Egestas Fusce</h3>
<p>Cras justo odio, dapibus ac facilisis egestas eget quam.</p>
</div>
<div class="post">
<img src="img/thumb5.png" alt="thumb1">
<h3>Purus Egestas Fusce</h3>
<p>Cras justo odio, dapibus ac facilisis egestas eget quam.</p>
</div>
<div class="post">
<img src="img/thumb6.png" alt="thumb1">
<h3>Purus Egestas Fusce</h3>
<p>Cras justo odio, dapibus ac facilisis egestas eget quam.</p>
</div>
</div> <!-- end of sixposts -->
</div><!-- end of blogspots -->
<div class="maincontent">
<h2>Ornare Tristique Adipiscing Dolor</h2>
<p>Cray sustainable vegan post-ironic mixtape. 8-bit sustainable sed put a bird on it keytar fingerstache et, ennui street art proident wayfarers viral ethnic. Eu craft beer anim, keffiyeh chambray occaecat jean shorts hella selvage keytar butcher vice in. American apparel pour-over master cleanse, fingerstache etsy qui umami dreamcatcher twee.</p>
<ul class="bullet">
<li>Cray sustainable vegan</li>
<li>Chambray occaecat jean shorts</li>
<li>Hella selvage</li>
<li>Over master cleanse</li>
</ul>
</div><!-- end of maincontent -->
<footer>
<p>© 2012 All Rights Reserved. Powered by Jeffrey Way Industries</p>
<ul>
<li>about</li>
<li>portfolio</li>
<li>contact</li>
</ul>
</footer>
</div> <!-- end of warp -->
</body>
</html>
Looks you have used background-image for list-items, however they are not visible in your code output. By removing float:left from .social ul li you will then able to see the background color of div.

Weird height with div box

One of my div is acting weird when I'm testing it in IE.
Here is the picture of it:
image http://img10.imageshack.us/img10/1395/mmmbme.png
The weird thing is that I have height: 1px;. I have no idea of fixing this, I've looked around for a long time for this issue.
Here is my CSS:
body{
background-image: url(images/bakgrund.png);
background-position: center;
background-repeat: no-repeat;
}
#main{
margin: 0px auto;
width: 1870px;
}
#fb{
position: absolute;
height: 69px;
width: 70px;
margin-top: 505px;
margin-left: 790px;
}
#nyheter{
position: absolute;
width: 460px;
height: 210px;
margin-top: 30px;
margin-left: 500px;
}
#nyheter a{
color: white;
}
#nyheter a:hover{
color: #c4c4c4;
}
h4{
font-size: 20px;
color: white;
}
#nyheter p{
margin-top: -25px;
}
h3{
font-weight: 800;
font-size: 20px;
}
#nyheter a:hover{
}
h2{
color: white;
font-family: "Bebas Neue";
font-weight: 400;
font-size: 50px;
position: absolute;
}
#fb:hover
{
}
#twitter a{
}
#twitter{
position: absolute;
height: 69px;
width: 70px;
margin-top: 505;
margin-left: 880px;
}
#banner {
height: 200px;
width: 1000px;
margin-top: -10px;
border: 1px solid transparent;
background-image: url(banner.png);
background-repeat: no-repeat;
background-position: center;
border: thin ridge #3a3a3a;
margin: 0px auto;
margin-left: 450px;
}
/*
#element1{
position: relative;
width: 1000px;
height: 710px;
margin: auto;
background-color: black;
filter:alpha(opacity=85);
-moz-opacity:.85;
opacity:.85;
z-index: 1;
} */
#content1{
width: 1000px;
height: 610px;
color: white;
text-align: left;
font-family: Makisupa;
z-index: 1;
border: thin ridge #3a3a3a;
background-color: black;
float: left;
margin-top: -2px;
margin-left: 450px;
}
#content2{
width: 1000px;
height: 100px;
margin-left: 450px;
position: relative;
color: #a8a8a8;
z-index: 2;
font-family: Arial, Helvetica, sans-serif;
font-size: small;
margin-top: 0.4px;
border: thin ridge #3a3a3a;
background-color: black;
}
#textcontent{
margin-left: 10px;
margin-top: 10px;
position: absolute;
}
#test:hover{
}
#test{
}
#copy{
margin-left: 855px;
margin-top: 60px;
position: absolute;
}
#kodad{
margin-left: 320px;
position: absolute;
margin-top: 70px;
font-size: x-small;
}
a{
text-decoration: none;
color: #a8a8a8;
}
a:hover{
color: white;
}
#textoperation{
margin-top: 15px;
margin-left: 20px;
}
#nyhet{
position: absolute;
font-family: Arial, Helvetica, sans-serif;
color: #bfbfbf;
font-size: 14px;
margin-left: 10px;
margin-top: 50px;
}
#huvudtext{
margin-top: -10px;
}
#rubrik h3{
font-size: 15px;
font-weight: 400;
}
#textinled{
position: absolute;
font-family: Arial, Helvetica, sans-serif;
color: #bfbfbf;
font-size: 15px;
margin-left: 20px;
margin-top: 130px;
}
#video{
position: absolute;
margin-left: 20px;
margin-top: 295px;
}
h2{
color: white;
font-family: "Bebas Neue";
font-weight: 400;
font-size: 40px;
position: absolute;
}
#nyhettext{
position: absolute;
margin-top: -23px;
margin-left: 10px;
}
#huvudtext{
}
#underline{
background-color: #3a3a3a;
position: absolute;
margin-top: 20px;
margin-left: 10px;
position: absolute;
width: 220px;
height: 3px;
}
#mitten{
position: absolute;
height: 570px;
width: 3;
background-color: #3a3a3a;
margin-top: 10px;
margin-left: 470px;
}
/*
#element2{
width: 1000px;
height: 50px;
margin: auto;
margin-top: -671px;
background-color: black;
filter:alpha(opacity=85);
-moz-opacity:.85;
opacity:.85;
z-index: 1;
}
*/
h1{
color: white;
font-family: "Bebas Neue";
font-weight: 400;
font-size: 50px;
position: absolute;
}
#cssmenu{
margin-top: 170px;
}
#cssmenu ul
{
margin: 0;
padding:0;
list-style-type:none;
width:auto;
position:relative;
display:block;
height:30px;
font-size:12px;
font-weight:bold;
background:transparent url(images/nav_bg.png) repeat-x top left;
font-family:Arial, Helvetica, sans-serif;
border-bottom:1px solid #000000;
border-top:1px solid #000000;
}
#cssmenu li
{
display:block;
float:left;
margin:0;
padding:0;
}
#cssmenu li a
{
display:block;
float:left;
color: white;
text-decoration:none;
font-weight:bold;
padding:8px 20px 0 20px;
}
#cssmenu li a:hover
{
color: #c4c4c4;
height:22px;
background:transparent url(images/nav_bg.png) 0px -30px no-repeat;
}
#cssmenu li.active a
{
display:inline;
height:22px;
background:transparent url(images/nav_bg.png) 0px -30px no-repeat;
float:left;
margin:0;
}
Here's my HTML code:
<?xml version="1.0"?>
<! DOCTYPE html PUPLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml/DTD/xhtml1/-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Start </title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<!--[if gte IE 6]>
<link rel="stylesheet" type="text/css" href="nycss.css" />
<![endif]-->
<![if !IE]>
<link rel="stylesheet" type="text/css" href="styles.css" />
<![endif]>
</head>
<body>
<div id="main">
<div id="banner">
<div id='cssmenu'>
<ul>
<li class='active '><a href='#'><span>Hem</span></a></li>
<li><a href='#'><span>Information</span></a></li>
<li><a href='#'><span>Om oss</span></a></li>
<li><a href='#'><span>Anmäla</span></a></li>
<li><a href='#'><span>Partners</span></a></li>
</ul>
</div>
</div>
<!--<div id="element1"></div> -->
<div id="content1">
<div id="background">
</div>
<div id="textoperation"><h1> Operation Pixel 19/02-13 </br>Folkets Hus i Karlshamn </h1></div>
<div id="textinled">
<p> Operation Pixel drivs av fem elever från JB Gymnasiet </br> i Karlshamn som ett projekt arbete. Vi som står för lanet </br> är Adam Erlandsson, Isak Risberg Jönsson, Jonatan Tjärnberg, </br>Victor Johansson och Lucas Mattsson.</p>
<p> Lanet kostar 200 kr och vara mellan 2013.02.19-2013-02.21. </br> Du kan även förhandsboka och betala 150 kr istället.</br> Klicka på Anmäla för att boka din plats. </p>
</div>
<div id="video">
<iframe width="410" height="280" src="http://www.youtube.com/embed/qP40Liau6z4" frameborder="0" allowfullscreen></iframe>
</div>
<div id="mitten"></div>
<div id="nyheter">
<div id="nyhettext"><h2> Nyheter </h2></div>
<div id="underline"></div>
<div id="nyhet">
<h4>Hemsidan är på gång nu</h4><p>Adam Erlandsson håller just nu på att utveckla Operation Pixelshemsida. Hemsidan kommer vara klart inom 1-2 veckor.</br> Mer information kommer inom kort.</p>
<h4> Datum och lokal är bestämd </h4><p> Vi har nu hittat en lokal (folkets hus) och datumet är </br> satt mellan 19/02-13 21/02-13. Lorem ipsum dolor sit amet, consectetur </br>adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </br></br>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate. </p>
<h4> Projekt arbete </h4> <p>ed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem ap
eriam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </br></br> Nemo enim ipsam voluptatem quia volup
tas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
</br></br><h3> Läs alla nyheter </h3>
</div>
</div>
<div id="fb">
<img src="images/fb.png">
</div>
<div id="twitter">
<img src="images/twitter.png">
</div>
</div>
<div id="content2">
<div id="textcontent">
<div id="test"> Hem </br></div>
<div id="test"> Information </br></div>
<div id="test"> Om Oss </br></div>
<div id="test"> Anmäla </br></div>
<div id="test"> Partners </div>
</div>
<div id="kodad">
<p> Code by Adam Erlandsson. Design by Adam Erlandsson & Victor Johansson </p>
</div>
<div id="copy">
<p> © 2012 Operation Pixel </p>
</div>
</div>
</div>
</body>
</html>
To be on the safe side, write a comment into the div and set its font-size and line-height also. In general, all visual styles should be expressed by stylesheets, not by HTML tags. Maybe you better add a CSS border.
#nyhettext h2 {
border-bottom: 3px solid #3a3a3a;
}
Anyway, the following should work with your current approach.
HTML
<div id="underline"><!-- --></div>
CSS
#underline{
background-color: #3a3a3a;
position: absolute;
margin-top: 20px;
margin-left: 10px;
/* position: absolute; */
width: 220px;
height: 3px;
font-size: 1px;
line-height: 1px;
}
One more thing: Do all these elements need to have an id? There should never be more than one element with the same id (see <div id="test">). Consider using class instead.