View doesn't reflect changes to CSS file - html

I'm using a partial view and if I load a page with the partial view, with CSS stylesheet is reflected as it should be.
But if I delete the Header.css or change something in it, the styling will be the same, according to the following code:
body {
}
#Header{
margin:auto;
height:50px;
width:100%;
padding:20px;
border-radius:5px;
background:linear-gradient(to bottom, #45484d 0%,#000000 100%);
color:white;
text-align:center;
vertical-align:middle;
}
.MenuContainer{
display:inline;
}
h3{
display:inline;
}
#HeaderList {
list-style-type:none;
}
.listForHead{
display:inline;
margin-top:20px;
}
<link type="text/css" rel="stylesheet" href="~/Content/Header.css" />
<script src='#Url.Content("~/Scripts/jquery-3.1.0.min.js")' type="text/javascript"></script>
<script src='#Url.Content("~/Scripts/jquery-ui-1.11.4.min.js")' type="text/javascript"></script>
<div id="Header">
<ul id="HeaderList">
<li class="listForHead">
<div class="MenuContainer">
<h3>Main</h3>
</div>
</li>
<li class="listForHead">
<div class="MenuContainer">
<h3>Methods of delivery</h3>
</div>
</li>
<li class="listForHead">
<div class="MenuContainer">
<h3>About shop</h3>
</div>
</li>
<li class="listForHead">
<div class="MenuContainer">
<h3>Contacts</h3>
</div>
</li>
</ul>
</div>

Related

How do i put my Navigation Bar on the left

I'm having trouble with putting my navigation bar on the left side of my simple webpage. It must be below the header section. This is the Whole HTML Code.
<html>
<head>
<title>My Homepage</title>
</head>
<style>
#header{
width:800px;
height:200px;
background-color:yellow;
}
#footer{
width:800px;
height:100px;
background-color:red;
clear:both;
}
#nav{
width:200px;
height:400px;
background-color:pink;
float:left;
}
#con{
width:800px;
height:400px;
background-color:gray;
}
</style>
<body>
<div id=external>
<div id=header><b>SAMPLE HEADER<b> <img src="kappa.gif"alt="kappa"height="50"width="50"></div>
<div id=con><iframe name=container width=100% height=100% src=default.html></iframe></div>
<div id=footer><b>PUP COPYRIGHT 2016<b> <img src="pup.jpg"alt="pup"height="50"width="50"></div>
<div id=nav>
<ul>
<li><a href=AboutUs.html target=container>About Us</a></li>
<li><a href=ContactUs.html target=container>Contact Us</a></li>
</ul>
</div>
I'm having trouble with putting my navigation bar on the left side of my simple webpage. It must be below the header section.
Your CSS will actually work perfectly if you move your nav markup up to be directly below your closing header div:
<div id=external>
<div id=header><b>SAMPLE HEADER<b> <img src="kappa.gif"alt="kappa"height="50"width="50"></div>
<div id=nav>
<ul>
<li><a href=AboutUs.html target=container>About Us</a></li>
<li><a href=ContactUs.html target=container>Contact Us</a></li>
</ul>
</div>
<div id=con><iframe name=container width=100% height=100% src=default.html></iframe></div>
<div id=footer><b>PUP COPYRIGHT 2016<b> <img src="pup.jpg"alt="pup"height="50"width="50"></div>
Please refer the code to make it
#nav {
width: 100%;
height: auto;
background-color: pink;
float: left;
}
<div id=external>
<div id=header><b>SAMPLE HEADER<b> <img src="kappa.gif"alt="kappa"height="50"width="50">
<div id=nav>
<ul>
<li><a href=AboutUs.html target=container>About Us</a></li>
<li><a href=ContactUs.html target=container>Contact Us</a></li>
</ul>
</div>
</div>
<div id=con><iframe name=container width=100% height=100% src=default.html></iframe></div>
<div id=footer><b>PUP COPYRIGHT 2016<b> <img src="pup.jpg" alt="pup" height="50" width="50"></div>
</div>

Linking external .css file to Html page

I'm having trouble linking my external file sheet to the separate html page. The .css file and html file are in the same folder also but when i run it the content is only appearing. Any help is appreciated. Thanks!
CSS Code
div
{
border-radius:5px;
}
#header
{
z-index:1;
width:97.%;
height:60px;
background-color:red;
margin-top:-20px;
margin-bottom:10px;
position:fixed;
}
#name
{
float:left;
margin-left:5px;
padding-top:5px;
font-size:16px;
font-family:Verdana, sans-serif;
color: #ffffff;
}
#email
{
float:left;
margin-left:5px;
padding-top:5px;
font-size:16px;
font-family:Verdana, sans-serif;
color: #ffffff;
}
#sidebar
{
left:90px;
top:160px;
position:fixed;
width:200px;
height:600px;
background-color:gray;
}
#content
{
left:290px;
top:160px;
position:fixed;
width:600px;
height:600px;
background-color:lightblue;
}
p
{
padding-left: 50px;
padding-top: 50px;
}
HTML Code
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="homepage.css" />
<title>HTML Project</title>
</head>
<body>
<div id="page">
<div class="topNaviagationLink">Home</div>
<div class="topNaviagationLink">About</div>
<div class="topNaviagationLink">Portfolio</div>
<div class="topNaviagationLink">Services</div>
<div class="topNaviagationLink">Contact</div>
</div>
<div id="mainPicture">
<div class="picture">
<div id="headerTitle">Project</div>
<div id="headerSubtext">HTML Project</div>
</div>
</div>
<div class="contentBox">
<div class="innerBox">
<div class="contentTitle">The Title of an Article</div>
<div class="contentText"><p>content </p><br />
<p>Content.</p><br />
<p>Other Content.</p></div>
</div>
</body>
</html>
That's what you need. See there please. I noticed lost div , check your code.
http://jsfiddle.net/vo9hLzqf/
If you feel problems with other styles like #email #name etc. check that in HTML you set right type
if your css is #email you should use <div id="email">%yourcode%</div>
and .email will be <div class="email">%yourcode%</div>
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="homepage.css" />
<title>HTML Project</title>
</head>
<body>
<div id="page">
<div class="topNaviagationLink">Home</div>
<div class="topNaviagationLink">About</div>
<div class="topNaviagationLink">Portfolio</div>
<div class="topNaviagationLink">Services</div>
<div class="topNaviagationLink">Contact</div>
</div>
<div id="mainPicture">
<div class="picture">
<div id="headerTitle">Project</div>
<div id="headerSubtext">HTML Project</div>
</div>
</div>
<div class="contentBox">
<div class="innerBox">
<div class="contentTitle">The Title of an Article</div>
<div class="contentText"><p>content </p><br />
<p>Content.</p><br />
<p>Other Content.</p></div>
</div>
</div>

My divs are ontop of each other

This is my website layout but for some reason my div left-menu goes through the footer instead of pushing it down where it belongs. I have tried clear:both; and overflow auto but i cant get it to go down. What am I doing wrong here?
here is a jsfiddle: http://jsfiddle.net/Qd3Rr/1/
html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="nl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>The Perfect Fluid Width Layout</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style-ie.css" />
<![endif]-->
</head>
<body>
<div id="inside">
<div id="header">
<table>
<form action="index.php" method="GET">
<tr><th>Zoek: </th><td><input type="text" name="searchword" value=""></td></tr>
<tr><th><input type="submit" value="submit"></td></tr>
</form>
</table>
</div>
<div id="navigation">
<ul>
<li>Home</li>
<li>Nieuwe Advertentie</li>
<li>Advertenties</li>
<?php
session_start();
if(isset($_SESSION['username'])){
echo '<li>Logout</li>';
}else{
echo'<li>Register</li>';
echo'<li>Login</li>';
}?>
</ul>
</div>
<div id="mainpage">
<div id="left-menu">
<h2>Kleding</h2>
<a href=>Shirts</a><br>
<a href=>Broeken</a><br>
<a href=>Jassen</a><br>
<a href=>Mutsen</a><br>
<a href=>Sjaals</a><br>
<a href=>Wanten</a><br>
<a href=>Schoenen</a><br>
<a href=>Sportkleding</a><br>
<a href=>Sweaters</a><br>
<a href=>Vesten</a><br>
<a href=>T-shirts</a><br><br>
<a href=>overig</a><br><br>
<h2>Geslacht</h2>
<a href=>Jongens</a><br>
<a href=>Meisjes</a><br>
<a href=>Beide</a><br>
<h2>Maten</h2>
<a href=>50(0-1 mnd)</a><br>
<a href=>56(1-2 mnd)</a><br>
<a href=>62(2-4 mnd)</a><br>
<a href=>68(4-6 mnd)</a><br>
<a href=>74(6-9 mnd)</a><br>
<a href=>80(9-12 mnd)</a><br>
<a href=>86(1-1,5 jaar)</a><br>
<a href=>92</a><br>
<a href=>98</a><br>
<a href=>104</a><br>
<a href=>110</a><br>
<a href=>116</a><br>
<a href=>122</a><br>
<a href=>128</a><br>
<a href=>134</a><br>
<a href=>140</a><br>
<a href=>146</a><br>
<a href=>152</a><br>
<a href=>158</a><br>
<a href=>164</a><br>
<a href=>176</a><br>
</div>
<div id="main-content">
<form action="login.php" method="post">
<table>
<tr><th><td><input type="text" name="username"></td></tr></th>
<tr><th><td><input type="password" name="password"></td></tr></th>
<tr><th><td><input name="submit" type="submit" value="submit"></td></tr></th>
</table>
</form>
</div>
</div>
<div id="footer">
<p>footer</p>
</div>
</div>
</body>
</html>
css:
#inside{
margin:8%;
padding:10px;
background:white;
}
#header{
border:1px solid;
background:#6F4E37;
height:60px;
}
#navigation{
border:1px solid;
height:29px;
margin-top:2%;
margin-top:1%;
margin-bottom:1%;
}
#navigation ul
{
margin: 0;
padding: 0;
}
#navigation ul li
{
list-style-type: none;
display: inline;
}
#navigation li a
{
display: block;
float: left;
padding: 5px 10px;
text-decoration: none;
border-right: 1px solid#ccc;
}
#navigation li a:hover {
background:#E42B2B;
}
#mainpage{
margin-top:1%;
margin-bottom:1%;
min-height:300px;
}
#left-menu{
float:left;
width:18%;
background:#6F4E37;
border:1px solid;
}
#left-menu h1{
float:left;
width:18%;
background:#6F4E37;
border:1px solid;
padding:10px;
}
#left-menu a{
padding: 15px;
text-decoration: none;
}
#main-content{
border:1px solid;
width:78%;
padding:5px;
margin-left:21.20%;
min-height:500px;
}
#footer{
border:1px solid;
margin-top:1%;
height:60px;
text-align:center;
}
You should use clear:both; at the end of <div id="mainpage">. Like in the DEMO (below the code).
<div id="mainpage">
<div id="left-menu">
...
</div>
<div id="main-content">
...
</div>
<div class="clear"></div>
</div>
Css:
.clear {clear:both;}
DEMO
Add:
<div style="clear: both;"></div>
just before the 'mainpage' closing div tag.
add display:inline-block to the div so it pushes the footer down

CSS divs not displaying inline

I have a HTML page like below:
<div id="header-wrapper">
<header class="header" id="header" role="banner">
<div class="logo-slogan-wrapper">
<a href="/d7/" title="Home" rel="home" class="header__logo" id="logo">
<img src="http://localhost/d7/sites/all/themes/zensub/logo.png" alt="Home" class="header__logo-image" />
</a>
<div class="header__name-and-slogan" id="name-and-slogan">
<h1 class="header__site-name" id="site-name">
<span>D7</span>
</h1>
</div>
</div>
<div class="header__region region region-header">
<div id="block-menu-block-1" class="block block-menu-block first last odd" role="navigation">
<div class="menu-block-wrapper menu-block-1 menu-name-main-menu parent-mlid-0 menu-level-1">
<ul class="menu">
<li class="menu__item is-active is-leaf first leaf active menu-mlid-218">Home</li>
<li class="menu__item is-leaf leaf menu-mlid-315">About</li>
<li class="menu__item is-leaf leaf menu-mlid-316">Contact</li>
<li class="menu__item is-leaf last leaf menu-mlid-317">Prestashop News</li>
</ul>
</div>
</div>
</div>
</header>
</div>
And my CSS is :
#header-wrapper{
background:#F7F7F7;
width:100%;
}
#header{
width:1150px;
margin:0 auto;
}
.logo-slogan-wrapper
{
display:inline;
background:#555;
}
.header__region
{
display:inline;
background:#99CC33;
}
#logo,#name-and-slogan,#site-name,#site-slogan
{
display:inline;
}
.menu-block-wrapper{
float:left;
padding:10px 0;
}
.menu li{
display:inline;
list-style:none;
margin-left:10px;
I was expecting the name,slogan and the menu to be inline. But instead , the menu is not coming inline and the background:#99CC33; for div header__region is not changing to the desired background color ! How can I overcome these problems ?
Depending on what you're going for:
.header__region {
float:left;
// or right
}
or
.header__region {
display: inline-block;
}

Container Div Won't Appear

My page has a layout with a top, middle and bottom section (they are all divs.) So far I have only been able to get the top and bottom areas to appear correctly. Even though the content of the middle is exactly the same as the bottom it just wont appear, therefore I am assuming a simple and obvious syntax era has most likely occurred, the thing is I have spent hour reading and troubleshooting to no avail, so please help!
Here is my HTML...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Saspadidious</title>
<link rel="stylesheet" type="text/css" href="CSS\home.css">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
</head>
<body>
<a href="home.html">
<div id="top">
<h1 class="header9">Sarspadidious</h1>
</div>
</a>
<div id="middle">
<div class="subOrange">
<h1 class="header6">Who?</h1>
</div>
<div class="subOrange">
<h1 class="header6">What?</h1>
</div>
<div class="subOrange">
<h1 class="header6">Why?</h1>
</div>
</div>
<div id="bottom">
<div class="subRed">
<a href="software.html">
<h1 class="header4">Software</h1>
</a>
</div>
<div class="subRed">
<a href="support.html">
<h1 class="header4">Support</h1>
</a>
</div>
<div class="subRed">
<a href="about.html">
<h1 class="header4">About</h1>
</a>
</div>
<div class="subRed">
<a href="news.html">
<h1 class="header4">News</h1>
</a>
</div>
</div>
</body>
</html>
And my CSS
body {
margin:0;
padding:0;
background-image:url('../Images/arches.PNG');
font-size:100%;
}
a {
text-decoration:none;
color:rgb(44,44,44);
}
#font-face {
font-family:"Mission Script";
src:url('../Other/Mission-Script.OTF');
}
#top {
position:relative;
width:90%;
margin-left:5%;
margin-right:5%;
margin-top:5%;
padding-top:4%;
padding-bottom:3%;
background-color:rgb(197,129,84);
border-color:rgb(44,44,44);
border-style:solid;
border-width:5px;
border-radius:15px;
-moz-border-radius:15px;
}
#middle {
position:relative;
width:95%;
margin-top:5%;
margin-left:2.5%;
margin-right:2.5%;
}
#bottom {
position:relative;
width:95%;
margin-top:5%;
margin-bottom:5%;
margin-left:2.5%;
margin-right:2.5%;
}
.subOrange {
position:relative;
width:26.6%;
margin-left:2.5%;
margin-right:2.5%;
padding-top:3%;
padding-bottom:3%;
background-color:rgb(255,159,72);
border-color:rgb(44,44,44);
border-style:solid;
border-width:5px;
border-radius:15px;
-moz-border-radius:15px;
float:left;
}
.subRed {
position:relative;
width:18.75%;
margin-left:2.5%;
margin-right:2.5%;
padding-top:3%;
padding-bottom:3%;
background-color:rgb(255,69,70);
border-color:rgb(44,44,44);
border-style:solid;
border-width:5px;
border-radius:15px;
-moz-border-radius:15px;
float:left;
}
.header4 {
font-family:"Mission Script";
font-size:4em;
text-align:center;
margin:0;
color:rgb(44,44,44);
}
.header6 {
font-family:"Mission Script";
font-size:6em;
text-align:center;
margin:0;
color:rgb(44,44,44);
}
.header9 {
font-family:"Mission Script";
font-size:9em;
text-align:center;
margin:0;
padding:0;
color:rgb(44,44,44);
}
So there it all is, the text in the middle div also does not display correctly, it does not become the right size or use Mission Script as its font.
EDIT: Here is a screenshot of what my browser does when it renders it.
I have figured it out! Yes the problem was simple. The page that has the problem in question is an about page, (about.html.)
During it's creation I copied and pasted much of it's code from the home page, (home.html.) What I forgot to do was link it to the new CSS sheet I created for it (about.css) as you can see in my original code above it is still linked to home.css.
I knew it was going to be obvious! THE RELIEF IS UNCANNY!
Here is the problem in code...
<link rel="stylesheet" type="text/css" href="CSS\home.css">
Change to
<link rel="stylesheet" type="text/css" href="CSS\about.css">
Thanks everyone, sorry for wasting your expertise on such an obvious error. Bloody hell.
Works fine for me on chrome for windows as well. However it fails the w3c validation for the doctype specified in your html either way, id start here http://validator.w3.org/ and make sure your markup matches the doctype you're going for.
For a start, you'll need to change this:
<a href="home.html">
<div id="top">
<h1 class="header9">Sarspadidious</h1>
</div>
</a>
to this:
<div id="top">
<h1 class="header9">Sarspadidious</h1>
</div>