Content div not extending as far as possible - html

So what seems to be the problem is my content div is not extending all the way down the page. The width is just how I want it, but the bottom seems to hover or get stuck in the middle of the page. This causes my footer to stick to the bottom of the content div as well. What can I do to fix this? I know there are a lot of questions like this one, but none of the answers seem to be working for me.
**<---HTML--->**
<!DOCTYPE html>
<html>
<head>
<title>Stan Mattingly</title>
<link type="text/css" rel="stylesheet" href="personalStyle.css"/>
</head>
<body>
<div id="header">
<a href="PersonalHome.html">
<p id = "logo">Stan Mattingly</p>
</a>
<a href="PersonalHome.html">
<p class = "button">Contact</p>
</a>
<a href="PersonalHome.html">
<p class = "button">About</p>
</a>
<a href="PersonalHome.html">
<p class = "button">Home</p>
</a>
</div>
<div id="content">
<h1>Click A Link To Get Started.</h1>
<div id = "social">
<a href="https://www.facebook.com/DontMakeYourArmsFallOff">
<img src="facebook button.png"/>
</a>
<a href="https://twitter.com/StanMattingly">
<img src="twitter logo.png"/>
</a>
<a href="http://soundcloud.com/djmicrocrush">
<img src="soundcloud logo.png"/>
</a>
<a href="http://www.hudl.com/athlete/2671311/stan-mattingly">
<img src="hudle logo.png"/>
</a>
</div>
</div>
<div id="footer">
<p>This is 100% designed and created by yours truly.</p>
</div>
</body>
</html>
<---CSS--->
#header
{
background-color: rgba(225,225,225,.6);
height: 60px;
width: 100%;
margin: -10px -20px 0px 0px;
font-size: 20px;
display: inline-block;
}
#logo
{
float: left;
margin: 15px 10px 0px 10px;
position: absolute;
}
.button
{
float: right;
margin: auto;
margin: 15px 10px 0px 10px;
}
#content
{
background-color: rgba(0,0,0,.8);
height: 100%;
width: 85%;
margin: -9px auto -15px auto;
padding: 10px;
color: white;
text-align: center;
}
#social
{
padding: 40px;
margin: 10px auto 10px auto;
display: inline-block;
}
#footer
{
background-color: rgba(225,225,225,.6);
height: 45px;
width: 100%;
margin-left: 0px;
text-align: center;
clear: both;
}
body, html{
height: auto;
width: auto;
margin-right: 0px;
margin-left: 0px;
margin-bottom:0px;
background-image: url("stars.jpg");
}
*
{
font-family: Segoe Script;
}
#header a:link
{
color: black;
text-decoration: none;
}
#header a:hover
{
color: rgba(0,0,0,.8);
text-decoration: none;
}
#header a:visited
{
text-decoration: none;
color: black
}
#content a:link
{
color: white;
text-decoration: none;
}
#content a:hover
{
color: rgba(225,225,225,.6);
text-decoration: none;
}
#content a:visited
{
text-decoration: none;
color: white;
}
#footer a:link
{
color: black;
text-decoration: none;
}
#footer a:hover
{
color: rgba(0,0,0,.8);
text-decoration: none;
}
#footer a:visited{
text-decoration: none;
color: black
}

Your content div will extend as far as it needs to extend, depending on how much "content" is in your content div. For example if I place a paragraph in the content div, it will extend as long as the paragraph makes it extend. Please check the code below with a paragraph inserted in the content div.
<!DOCTYPE html>
<html>
<head>
<title>Stan Mattingly</title>
<link type="text/css" rel="stylesheet" href="personalStyle.css"/>
</head>
<body>
<div id="header">
<a href="PersonalHome.html">
<p id = "logo">Stan Mattingly</p>
</a>
<a href="PersonalHome.html">
<p class = "button">Contact</p>
</a>
<a href="PersonalHome.html">
<p class = "button">About</p>
</a>
<a href="PersonalHome.html">
<p class = "button">Home</p>
</a>
</div>
<div id="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non dapibus turpis, ac tincidunt eros. Nullam eget facilisis est. Nam at malesuada nunc. Duis metus arcu, iaculis at dapibus eu, semper suscipit diam. Pellentesque pellentesque nec libero et fringilla. Praesent pharetra placerat felis, tempor laoreet urna accumsan ac. Vivamus iaculis, odio nec pulvinar varius, magna dui interdum diam, nec blandit ligula justo ac quam. Fusce tempor, velit eu fringilla consequat, metus ante molestie tortor, ac volutpat nisi leo non nulla. Etiam sed nunc non magna porttitor sodales vel id ligula. Cras porta enim lorem, in pulvinar est dictum non. Cras ut dui fringilla sapien porta dictum. Proin egestas fermentum libero, nec tincidunt velit fringilla at. Cras lacinia ligula vehicula egestas interdum. Proin feugiat urna ligula, sodales gravida sem accumsan sed. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc eros lorem, varius at lobortis ut, vehicula id metus. Donec at tellus at urna eleifend auctor. Fusce vitae orci risus. Quisque convallis ut orci in commodo. Nulla nec tellus non sem adipiscing tristique a sed nisi. Aenean arcu elit, condimentum non odio sit amet, tincidunt consectetur dolor. Ut lorem elit, lacinia nec justo eu, sodales aliquet nulla. Morbi luctus in nunc quis molestie. Maecenas ut bibendum quam. Integer rhoncus viverra ligula et lacinia. Pellentesque augue magna, imperdiet quis nulla vel, congue dignissim justo. Etiam ut vulputate nibh, et lobortis neque. Vestibulum pellentesque orci ut eros posuere, quis malesuada purus vestibulum. Aenean ultricies justo faucibus eros ultrices, sed vestibulum sem luctus. Nam pulvinar, quam in rhoncus facilisis, urna dui blandit magna, nec auctor quam orci eu eros. Ut et justo nisi. Duis ligula lectus, pulvinar eget dui a, porttitor congue risus. Donec ac eros eleifend, faucibus ipsum molestie, lacinia augue. Fusce suscipit quis nunc fermentum posuere. Integer gravida scelerisque mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris a eros mi. Morbi molestie, dolor id pellentesque venenatis, nunc quam venenatis felis, at sollicitudin nisi lectus id lectus. Vestibulum quis vulputate purus, in varius arcu. Donec ut massa tellus. Ut fringilla nisl tempus mi tincidunt scelerisque. Sed sit amet egestas elit, vitae vestibulum nisl. Etiam suscipit commodo varius. Nullam bibendum orci felis, vitae suscipit risus pharetra id. Etiam nec convallis ipsum. Nullam facilisis mi eget nulla pulvinar, at placerat risus malesuada. Nullam id est nulla. Proin aliquet est dui, ut sollicitudin mauris condimentum eget. Nam dictum arcu id venenatis lacinia. Donec vel mi sit amet ipsum adipiscing rhoncus. Phasellus blandit vestibulum nisl ac fringilla. Vestibulum metus augue, auctor vitae accumsan a, bibendum at elit. Proin erat purus, placerat sed cursus vel, placerat ac erat. Pellentesque id egestas enim, ac vehicula tellus. </p>
<h1>Click A Link To Get Started.</h1>
<div id = "social">
<a href="https://www.facebook.com/DontMakeYourArmsFallOff">
<img src="facebook button.png"/>
</a>
<a href="https://twitter.com/StanMattingly">
<img src="twitter logo.png"/>
</a>
<a href="http://soundcloud.com/djmicrocrush">
<img src="soundcloud logo.png"/>
</a>
<a href="http://www.hudl.com/athlete/2671311/stan-mattingly">
<img src="hudle logo.png"/>
</a>
</div>
</div>
<div id="footer">
<p>This is 100% designed and created by yours truly.</p>
</div>
</body>
</html>

A Little Change in CSS
<style type="text/css">
#header
{
background-color: rgba(225,225,225,.6);
height: 60px;
width: 85%;
font-size: 20px;
display: inline-block;
margin-left: 150px;
margin-right: auto;
}
#logo
{
float: left;
margin: 15px 10px 0px 10px;
position: absolute;
}
.button
{
float: right;
margin: auto;
margin: 15px 10px 0px 10px;
}
#content
{
background-color: rgba(0,0,0,.8);
height: 100%;
width: 85%;
margin-left: auto;
margin-right: auto;
padding: 10px;
color: white;
text-align: center;
}
#social
{
padding: 40px;
margin: 10px auto 10px auto;
display: inline-block;
}
#footer
{
background-color: rgba(225,225,225,.6);
height: 45px;
width: 85%;
margin-left: auto;
margin-right: auto;
text-align: center;
clear: both;
}
body, html{
height: auto;
width: auto;
margin-right: 0px;
margin-left: 0px;
margin-bottom:0px;
background-image: url("stars.jpg");
}
*
{
font-family: Segoe Script;
}
#header a:link
{
color: black;
text-decoration: none;
}
#header a:hover
{
color: rgba(0,0,0,.8);
text-decoration: none;
}
#header a:visited
{
text-decoration: none;
color: black
}
#content a:link
{
color: white;
text-decoration: none;
}
#content a:hover
{
color: rgba(225,225,225,.6);
text-decoration: none;
}
#content a:visited
{
text-decoration: none;
color: white;
}
#footer a:link
{
color: black;
text-decoration: none;
}
#footer a:hover
{
color: rgba(0,0,0,.8);
text-decoration: none;
}
#footer a:visited{
text-decoration: none;
color: black }
*.cImg
{
width: 50px;
height: 50px;
}
</style>
HTML:
<div id="header">
<a href="PersonalHome.html">
<p id = "logo">Stan Mattingly</p>
</a>
<a href="PersonalHome.html">
<p class = "button">Contact</p>
</a>
<a href="PersonalHome.html">
<p class = "button">About</p>
</a>
<a href="PersonalHome.html">
<p class = "button">Home</p>
</a>
</div>
<div id="content">
<h1>Click A Link To Get Started.</h1>
<div id = "social">
<a href="https://www.facebook.com/DontMakeYourArmsFallOff">
<img src="facebook button.png"/>
</a>
<a href="https://twitter.com/StanMattingly">
<img src="twitter logo.png"/>
</a>
<a href="http://soundcloud.com/djmicrocrush">
<img src="soundcloud logo.png"/>
</a>
<a href="http://www.hudl.com/athlete/2671311/stan-mattingly">
<img src="hudle logo.png"/>
</a>
</div>
</div>
<div id="footer">
<p>This is 100% designed and created by yours truly.</p>
</div>
I don't know what u mean exactly, but test that and tell me back what u want exactly. I will help u.

#header
{
background-color: rgba(225,225,225,.6);
height: 15%;
width: 100%;
margin: -10px -20px 0px 0px;
font-size: 20px;
display: inline-block;
}
#logo
{
float: left;
margin: 15px 10px 0px 10px;
position: absolute;
}
.button
{
float: right;
margin: auto;
margin: 15px 10px 0px 10px;
}
#content
{
background-color: rgba(0,0,0,.8);
height: 80%;
width: 98%;
margin: -9px auto -15px auto;
padding: 10px;
color: white;
text-align: center;
position:absolute;
}
#social
{
padding: 40px;
margin: 10px auto 10px auto;
display: inline-block;
}
#footer
{
background-color: rgba(225,225,225,.6);
height: 20%;
width: 100%;
margin-left: 0px;
text-align: center;
clear: both;
padding-top:40%
}
body, html{
height: auto;
width: auto;
margin-right: 0px;
margin-left: 0px;
margin-bottom:0px;
background-image: url("stars.jpg");
}
*
{
font-family: Segoe Script;
}
#header a:link
{
color: black;
text-decoration: none;
}
#header a:hover
{
color: rgba(0,0,0,.8);
text-decoration: none;
}
#header a:visited
{
text-decoration: none;
color: black
}
#content a:link
{
color: white;
text-decoration: none;
}
#content a:hover
{
color: rgba(225,225,225,.6);
text-decoration: none;
}
#content a:visited
{
text-decoration: none;
color: white;
}
#footer a:link
{
color: black;
text-decoration: none;
}
#footer a:hover
{
color: rgba(0,0,0,.8);
text-decoration: none;
}
#footer a:visited{
text-decoration: none;
color: black
}

Related

HTML Webpage Sidebars Acting Up

Help, have been working for hours on this HTML Page. I've been viewing it in Chrome, but when I resize the page I notice that the sidebars I've added cover up everything.
Here is what I wanted to do:
Have a scroll bar when the page is resized (Keeping the page the same)
Have one side bar one side, and to be able to slide over the page to find the other scroll bar. (I dont want the. covering everything up like they are now..)
Here is the code:
#img1 {
width: 400px;
padding-bottom: 25px;
}
#container1 {
text-align: center;
}
#heading-contain {
background-color: LightSeaGreen;
width: 650px;
margin: auto;
border-radius: 7px;
font-family: "adam", arial;
color: white;
}
#heading2 {
border-top: 1px solid white;
}
#heading1 {
position: relative;
top: 15px;
}
#heading2 h3 {
position: relative;
bottom: 6px;
color: DarkSlateGrey;
}
#main-content {
width: 650px;
margin: auto;
margin-top: 30px;
background-color: LightSlateGrey;
border-radius: 8px;
}
#text1 {
padding-bottom: 30px;
padding-top: 20px;
font-family: arial;
color: white;
margin-left: 20px;
margin-right: 20px;
line-height: 200%;
}
#name {
color: DarkSeaGreen;
font-weight: bold;
font-family: "dragon is coming";
font-size: 300%;
}
body {
background-image: url("https://lh4.ggpht.com/X5kjAhye8_5IE9Ws3Z0e05aIAsP_jCSbsh1hja0nNdF8GczkNd0aZQEe7w1V5-2B-9k=h900");
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
}
#footer {
background-color: LightSeaGreen;
color: white;
border: 1px double white;
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
height: 30px;
padding: 5px;
font-family: "adam";
font-weight: bold;
}
#footer p {
margin: 5px;
}
#name:hover {
color: LightCoral;
cursor: default;
}
#line1 {
text-align: center;
}
#paragraph {
text-indent: 50px;
display: inline-block;
}
#sidebar-left {
background-color: LightSeaGreen;
width: 200px;
height: 100%;
display: block;
position: absolute;
left: 0px;
top: 0px;
position: fixed;
font-family: "adam";
color: white;
}
ul {
margin: 0px;
padding: 0px;
}
ul li {
list-style: none;
}
ul li a {
background-color: LightSlateGrey;
color: white;
border-bottom: 1px solid white;
display: block;
width: 180px;
padding: 10px;
text-decoration: none;
}
li:hover {
background-color: DarkSeaGreen;
}
#sidebar-right {
background-color: LightSeaGreen;
width: 200px;
height: 100%;
position: absolute;
right: 0px;
top: 0px;
position: fixed;
font-family: "adam";
color: white;
}
#sidebar-right h4 {
width: 180px;
padding: 10px;
}
#sidebar-right img {
width: 160px;
margin-left: 20px;
margin-right: 20px;
margin-top: 10px;
}
#sidebar-right p {
font-size: 13px;
padding-right: 6px;
padding-left: 6px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML WEBPAGE 2 | Brett Carwile</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="container1">
<!-- Container1 contains all the elements on the page !-->
<div id="heading-contain">
<!-- Heading-container contains everything in the header !-->
<div id="heading1">
<!-- Heading1 is the top of the header which includes the h1 !-->
<h1>HTML Webpage 2</h1>
</div>
<div id="heading2">
<!-- Heading2 is the bottom half of the header including the h3 !-->
<h3>By Brett Carwile</h3>
</div>
</div>
<div id="sidebar-right">
<h4>About the Author</h4>
<img src="DSC00071.jpg">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ullamcorper gravida facilisis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sed dui diam. Nulla facilisi. Donec rhoncus dolor malesuada urna commodo lacinia. Sed vel nisi
venenatis, aliquet nibh at, lobortis lacus. Etiam enim lacus, venenatis a sagittis ac, rhoncus in velit. Pellentesque turpis massa, condimentum eget eleifend non, sit amet justo. Vivamus accumsan iaculis placerat. Quisque blandit diam ut risus
ultrices rutrum. Mauris pretium in augue ut lobortis. Vivamus tempor ac nisl at euismod. Maecenas laoreet a erat a varius. Curabitur consequat nunc vehicula tellus ornare, vitae aliquet sapien varius.
</P>
</div>
<div id="sidebar-left">
<ul>
<li>Link 1
</li>
<li>Link 2
</li>
<li>Link 3
</li>
<li>Link 4
</li>
<li>Link 5
</li>
</ul>
<p>Check out the awesome links above!!</p>
</div>
<div id=main-content>
<!-- This div is the main area below the header (text, img ect...) !-->
<p id="text1">
<!-- This span is to seperate the first line from the rest of the text !-->
<span id="line1"> This is an HTML webpage by <span id="name">Brett Carwile</span>.</span>
<br>
<!-- This span is so that we can indent the text !-->
<span id="paragraph">This is a text sample. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id quam nulla. Nam sollicitudin porta ligula, sit amet pharetra elit tincidunt sit amet. Suspendisse rhoncus, elit at consectetur sagittis, nisi eros molestie urna, et cursus elit sapien quis ante. Sed sit amet pulvinar neque. Pellentesque eget lorem ac lorem sodales rutrum. Nulla erat nisl, consequat non ante vitae, porttitor convallis magna. Duis pulvinar ornare nisi nec varius. Mauris tempus nisi non viverra vulputate. Interdum et malesuada fames ac ante ipsum primis in faucibus. Maecenas vestibulum viverra erat eu rhoncus.
Cras nec vulputate leo. Donec nunc mauris, varius id ligula eu, tincidunt euismod lorem. Praesent pharetra, ipsum et congue egestas, sapien augue feugiat lacus, ac tincidunt augue leo ut tortor. Mauris efficitur urna ut turpis ornare, eu consectetur lacus dapibus. Curabitur sit amet justo blandit est fermentum volutpat. Sed in gravida nunc. Integer sit amet risus in justo porttitor cursus. Mauris tortor purus, viverra a lacus et, suscipit molestie tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; </span>
</p>
<img src="DSC00071.jpg" id="img1">
<div id="footer">
<p>Thank you for viewing!!! © Brett Carwile 2016</p>
</div>
</div>
</div>
</body>
</html>
You can try the HTML/CSS and resize the window to see what I mean.
Adding min-width to the body element and removing the position fixed for the sidebar-left and sidebar-right will make the trick. Please see below the modified css rules.
body {
min-width: 1200px; //Modify depending on your requirements
background-image: url("https://lh4.ggpht.com/X5kjAhye8_5IE9Ws3Z0e05aIAsP_jCSbsh1hja0nNdF8GczkNd0aZQEe7w1V5-2B-9k=h900");
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
}
#sidebar-left {
background-color: LightSeaGreen;
width: 200px;
height: 100%;
display: block;
position: absolute;
left: 0px;
top: 0px;
font-family: "adam";
color: white;
}
#sidebar-right {
background-color: LightSeaGreen;
width: 200px;
height: 100%;
position: absolute;
right: 0px;
top: 0px;
font-family: "adam";
color: white;
}
I hope it helps.

Wrapping list text around another image in the list

I have a profile section containing a list of text items. I want the text to wrap around the profile image.
Currently I have this fiddle: https://jsfiddle.net/3an39f3g/1/
I want the .desc text to sit under the job title, but then flow around the image and go to 100% width under the image.
Snippet:
ul li {
width: 400px;
list-style-type: none;
}
.name {
font-size: 15px;
color: black;
margin-bottom: 16px;
width: 40%;
float: left;
}
.job-title {
color: #7b7b7b;
font-size: 15px;
margin-bottom: 30px;
width: 40%;
float: left;
}
.desc {
font-size: 15px;
line-height: 27px;
width: 100%;
float: left;
}
img {
width: 45%;
margin-right: 10%;
float: left;
}
<li>
<ul>
<li><img src="http://www.clker.com/cliparts/0/P/y/1/z/v/placeholder-md.png"></img></li>
<li class="name">JOHN SMITH</li>
<li class="job-title">Job Title</li>
<li class="desc">Suspendisse blandit, mi et vehicula maximus, nisl justo pharetra ligula, vitae aliquam est nulla sed magna. Vivamus neque mi, ultricies ut felis nec, finibus vestibulum diam. Donec rhoncus orci at sem varius lacinia.</li>
</ul>
</li>
If you want the layout to work with any width, move the image outside the list containing the text.
New fiddle:
https://jsfiddle.net/okqmzrss/1/
Snippet:
ul li {
width: 400px;
list-style-type: none;
}
li img {
width: 45%;
margin-right: 10%;
display: inline;
float: left;
}
.name {
font-size: 15px;
color: black;
margin-bottom: 16px;
width: 40%;
float: left;
}
.job-title {
color: #7b7b7b;
font-size: 15px;
margin-bottom: 30px;
width: 40%;
float: left;
}
.desc {
font-size: 15px;
line-height: 27px;
width: 100%;
}
<li>
<img src="http://www.clker.com/cliparts/0/P/y/1/z/v/placeholder-md.png"></img>
<ul>
<li class="name">JOHN SMITH</li>
<li class="job-title">Job Title</li>
<li class="desc">Suspendisse blandit, mi et vehicula maximus, nisl justo pharetra ligula, vitae aliquam est nulla sed magna. Vivamus neque mi, ultricies ut felis nec, finibus vestibulum diam. Donec rhoncus orci at sem varius lacinia.</li>
</ul>
</li>
Try this jsfiddle
html:
<li>
<img src="http://www.clker.com/cliparts/0/P/y/1/z/v/placeholder-md.png"></img>
<div class="description">
<p class="name">JOHN SMITH</p>
<p class="job-title">Job Title</p>
<p class="desc">Suspendisse blandit, mi et vehicula maximus, nisl justo pharetra ligula, vitae aliquam est nulla sed magna. Vivamus neque mi, ultricies ut felis nec, finibus vestibulum diam. Donec rhoncus orci at sem varius lacinia. Suspendisse blandit, mi et vehicula maximus, nisl justo pharetra ligula, vitae aliquam est nulla sed magna. Vivamus neque mi, ultricies ut felis nec, finibus vestibulum diam. Donec rhoncus orci at sem varius lacinia.</li>
</p>
css:
li{
list-style-type: none;
}
img{
margin-right: 5%;
margin-bottom: 15px;
float: left;
}
.name {
font-size: 15px;
color: black;
margin-bottom: 16px;
}
.job-title {
color: #7b7b7b;
font-size: 15px;
margin-bottom: 30px;
}

HTML Managing different resolutions

I build a web page on a 1366 * 768 resolution PC. I used percentage and px to adjust distance etc. But after competition when I ran it into 1920*1080 resolution then everything just jumbled up.
So, how to manage CSS so that it runs without distortion on any PC with any resolution.
<html>
<head>
<title>About US..</title>
<script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="js/about.js"></script>
<link rel="shortcut icon" href="img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/about.css">
</head>
<body>
<div class="main">
<div class="header">
<div class="header1">
</div>
<div class="left">
</div>
<a href="index.html"><div class="left1">
</div></a>
<div class="left2">
In a Nut Shell..
</div>
<a href="about.html" id="left1a"><div class="left3">
About Us
</div></a>
<a href="contact.html" id="left1b"><div class="left4">
Contact Us
</div></a>
</div>
<div class="content">
Meet developers Of "In a Nut Shell.."<br>
<div class="geetika">
<div id="top">
<div id="circle">
</div>
</div>
<div id="bottom"><br>
<font color="black">Geetika</font><br>
<p>I am currently Pursuing My Btech From KIIT University. Have a lot Of interest in Website Designing and other Stuff<p>
<br><br><br>
Click to know more
</div>
</div>
<div class="nikhil">
<div id="top">
<div id="circle">
</div>
</div>
<div id="bottom"><br>
<font color="black">Nikhil Srivastava</font><br>
<p>I am currently Pursuing My Btech From KIIT University. Have a lot Of interest in Website Designing and other Stuff<p>
<br><br><br>
<a href="#" id="nik1" >Wanna Know More ;)</a>
</div>
</div>
<div class="sumegha">
<div id="top">
<div id="circle">
</div>
</div>
<div id="bottom"><br>
<font color="black">Sumegha Mukherjee</font><br>
<p>I am currently Pursuing My Btech From KIIT University. Have a lot Of interest in Website Designing and other Stuff<p>
<br><br><br>
Click to know more
</div>
</div>
<div class="nikdetail">
Nikhil Srivastava
<div id="banner">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis iaculis lectus vitae finibus. Sed ac turpis at eros semper interdum et et sem. Pellentesque convallis dictum ligula, et luctus dolor tristique vel. Fusce non augue in risus venenatis fermentum quis eu purus. Ut dictum tincidunt est, eu commodo orci hendrerit ultrices. Phasellus fermentum metus a purus finibus, et sagittis lacus placerat. Integer rutrum, sapien et efficitur fringilla, metus elit scelerisque turpis, et iaculis massa lacus ut odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque vehicula pretium ligula vitae mollis. Vestibulum sed sem ex. Interdum et malesuada fames ac ante ipsum primis in faucibus. Mauris rutrum turpis eget pulvinar vulputate. Vestibulum consectetur vulputate egestas. Sed dictum, augue in volutpat aliquam, ante nisi eleifend massa, non tempus dui leo eu odio.
</p>
<br><br><br>
Go Back
</div>
</div>
<div class="geetdetail">
Geetika
<div id="banner">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis iaculis lectus vitae finibus. Sed ac turpis at eros semper interdum et et sem. Pellentesque convallis dictum ligula, et luctus dolor tristique vel. Fusce non augue in risus venenatis fermentum quis eu purus. Ut dictum tincidunt est, eu commodo orci hendrerit ultrices. Phasellus fermentum metus a purus finibus, et sagittis lacus placerat. Integer rutrum, sapien et efficitur fringilla, metus elit scelerisque turpis, et iaculis massa lacus ut odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque vehicula pretium ligula vitae mollis. Vestibulum sed sem ex. Interdum et malesuada fames ac ante ipsum primis in faucibus. Mauris rutrum turpis eget pulvinar vulputate. Vestibulum consectetur vulputate egestas. Sed dictum, augue in volutpat aliquam, ante nisi eleifend massa, non tempus dui leo eu odio.
</p>
<br><br><br>
Go Back
</div>
</div>
<div class="sumeghadetail">
Sumegha Mukherjee
<div id="banner">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis iaculis lectus vitae finibus. Sed ac turpis at eros semper interdum et et sem. Pellentesque convallis dictum ligula, et luctus dolor tristique vel. Fusce non augue in risus venenatis fermentum quis eu purus. Ut dictum tincidunt est, eu commodo orci hendrerit ultrices. Phasellus fermentum metus a purus finibus, et sagittis lacus placerat. Integer rutrum, sapien et efficitur fringilla, metus elit scelerisque turpis, et iaculis massa lacus ut odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque vehicula pretium ligula vitae mollis. Vestibulum sed sem ex. Interdum et malesuada fames ac ante ipsum primis in faucibus. Mauris rutrum turpis eget pulvinar vulputate. Vestibulum consectetur vulputate egestas. Sed dictum, augue in volutpat aliquam, ante nisi eleifend massa, non tempus dui leo eu odio.
</p>
<br><br><br>
Go Back
</div>
</div>
</div>
</div>
</body>
</html>
and CSS:
body{
background: #BDBDBD;
}
.main{
width: 100%;
height: 100%;
}
.header {
width:100%;
height:5%;
z-index: 10;
float: left;
}
.header1 {
z-index: 10;
position: fixed;
width: 100%;
background-image: url("../img/w3.jpg");
-webkit-filter: blur(1px);
-moz-filter: blur(1px);
-o-filter: blur(1px);
-ms-filter: blur(1px);
filter: blur(1px);
float: left;
height: inherit;
margin-top: -8px;
margin-left:-8px;
}
.left{
float:left;
z-index: 9999;
font-size: 30px;
font-family: cursive;
color: white;
height: 40px;
width: 30%;
}
.left1{
position: fixed;
float:left;
z-index: 9999;
font-size: 30px;
font-family: cursive;
color: white;
height: 40px;
background-image: url("../img/favicon.ico");
background-repeat: no-repeat;
background-size: 45px 34px;
width: 40px;
margin-left: 10%;
margin-top: -5px;
}
.left2{
position: fixed;
float:left;
z-index: 11;
z-index: 9999;
font-size: 35px;
font-family: buxton sketch;
color: white;
margin-left: 15%;
margin-top: -5px;
}
.left3{
position: fixed;
float:left;
z-index: 9999;
font-size: 20px;
font-family: cursive;
color: white;
float: left;
margin-left: 70%;
width: 100px;
padding-left: 5px;
}
.left4{
position: fixed;
float:left;
z-index: 11;
font-size: 20px;
font-family: cursive;
color: white;
margin-left: 80%;
width: 110px;
padding-left: 5px;
}
.content{
background: -webkit-linear-gradient(#BDBDBD, #FBEFFB);
background: -o-linear-gradient(#99390D, #D25318);
background: -moz-linear-gradient(#99390D, #D25318);
background: linear-gradient(#BDBDBD, #FBEFFB);
width: auto;
height: inherit;
margin-right: -8px;
margin-left: -8px;
padding-bottom: 8px;
font-size: 35px;
text-align: center;
font-family: buxton sketch;
color: black;
}
.nikhil{
float: left;
width:250px;
height: 500px;
margin-top: 25px;
margin-left: 50px;
background-color:rgba(0,0,0,0.1);
box-shadow:5px 5px 5px 1px black;
}
.geetika{
width:250px;
float: left;
height: 500px;
margin-top: 25px;
margin-left: 18%;
background-color:rgba(0,0,0,0.1);
box-shadow:5px 5px 5px 1px black;
}
.sumegha{
width:250px;
height: 500px;
float: left;
margin-top: 25px;
margin-left: 50px;
background-color:rgba(0,0,0,0.1);
box-shadow:5px 5px 5px 1px black;
}
.nikhil #top{
width: 100%;
height: 100px;
background-color:#0000FF;
}
.nikhil #bottom{
width: 100%;
height: 400px;
font-size: 20px;
text-align: center;
font-family: cursive;
color: #4B4B4E;
}
.nikhil #bottom a{
color: black;
text-decoration: none;
}
.nikhil #top #circle{
width: 100px;
height: 100px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
margin-left: 75px;
background-image: url("../img/nik1.JPG");
background-size: 100px 100px;
background-repeat: no-repeat;
}
.sumegha #bottom a{
color: black;
text-decoration: none;
}
.sumegha #top{
width: 100%;
height: 100px;
background-color:#0000FF;
}
.sumegha #bottom{
width: 100%;
height: 400px;
font-size: 20px;
text-align: center;
font-family: cursive;
color: #4B4B4E;
}
.sumegha #top #circle{
width: 100px;
height: 100px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
margin-left: 75px;
background-image: url("../img/sumegha.jpg");
background-size: 100px 100px;
background-repeat: no-repeat;
}
.geetika #top{
width: 100%;
height: 100px;
background-color:#0000FF;
}
.geetika #bottom{
width: 100%;
height: 400px;
font-size: 20px;
text-align: center;
font-family: cursive;
color: #4B4B4E;
}
.geetika #top #circle{
width: 100px;
height: 100px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
margin-left: 75px;
background-image: url("../img/geetika.jpg");
background-size: 100px 100px;
background-repeat: repeat;
}
.geetika #bottom a{
color: black;
text-decoration: none;
}
.nikdetail{
border: 1px solid black;
margin-left: 5%;
width: 90%;
height: 500px;
background-color: black;
font-family: ALGERIAN;
color: white;
display:none;
}
.nikdetail #banner{
font-family:Lucida Handwriting;
font-size: 18px;
}
.nikdetail #banner a{
font-family:Lucida Handwriting;
text-decoration: none;
color: white;
}
.geetdetail{
border: 1px solid black;
margin-left: 5%;
width: 90%;
height: 500px;
background-color: black;
font-family: ALGERIAN;
color: white;
display:none;
}
.geetdetail #banner{
font-family:Lucida Handwriting;
font-size: 18px;
}
.geetdetail #banner a{
font-family:Lucida Handwriting;
text-decoration: none;
color: white;
}
.sumeghadetail{
border: 1px solid black;
margin-left: 5%;
width: 90%;
height: 500px;
background-color: black;
font-family: ALGERIAN;
color: white;
display:none;
}
.sumeghadetail #banner{
font-family:Lucida Handwriting;
font-size: 18px;
}
.sumeghadetail #banner a{
font-family:Lucida Handwriting;
text-decoration: none;
color: white;
}
With CSS media queries, you can target screen resolutions.
#media (max-width: 767px) {
/*mobile screen styles*/
}
#media (min-width: 768px) and (max-width: 991px) {
/*tablet screen styles*/
}
#media (min-width: 992px) and (max-width: 1199px) {
/*small desktop screen styles*/
}
#media (min-width: 1200px) {
/*large desktop screen styles*/
}
I would strongly recommend looking at Bootstrap as a frontend framework. It has responsive design already built into it and much more.

how do I stop my nav links from moving when zooming out on the page?

I know there are other questions out there similar to this that have been answered but they don't quite fit what I need. My problem is, whenever I zoom out on the page past a certain point (anything below 50% zoom), the 1 or 2 links at the end of my nav bar get pushed down to a second line below the rest of them. But this doesn't occur when the page is at a normal or large size. The links also don't change size or proportion when the window is resized, only when zoom is at 33% or 25%. I've tried all kinds of "position" stuff with both the ".nav-style" and "a" in my CSS but nothing seems to be working.
How can I get the links on the right end of the nav bar to shrink and stay in their relative proportions to the rest of the page when I zoom all the way out?
Here is my html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="div1">
<h1>ConSynth Corporation</h1>
<p></p>
<div class="nav-style">
<p>Home
About Us
Project Gallery
News
Contact Us
Resources
</p>
</div>
</div>
<div class="div2">
<p></p>
</div>
<div class="div3">
<p></p>
</div>
<div id="black-box">
<div id="black-box-text"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum enim sem, gravida eu facilisis vel, mollis eget turpis. Morbi dignissim magna eu dui sagittis, ac semper enim ullamcorper. Phasellus scelerisque lobortis libero et laoreet. Vivamus suscipit erat sed quam consequat, pharetra dignissim ligula pharetra. Nulla a dui vel eros viverra rutrum sed at orci. Nullam id aliquam sem, in eleifend lectus. Integer non libero et eros sagittis tincidunt. Nam ornare, est sed dapibus auctor, lectus lorem luctus elit, at semper enim odio ac metus. Aliquam lacinia lacinia turpis et dapibus.
<br />
<br />
Integer ac magna lobortis, dictum ligula sed, vestibulum urna. Cras eget placerat augue. Sed sit amet purus magna. Sed malesuada, nulla vitae consectetur posuere, diam odio accumsan metus, eget consectetur odio ante at velit. Etiam tincidunt justo at augue porttitor vulputate. Suspendisse hendrerit sit amet sem porta suscipit. Donec porta libero odio, non commodo orci faucibus at. Duis nisl erat, facilisis ut sem adipiscing, luctus scelerisque ante. Vestibulum felis dolor, porta eu nunc vel, sodales semper lorem. Curabitur varius lorem eget accumsan aliquam. Nam sem odio, condimentum et cursus nec, tempor id ipsum.
<br />
<br />
Duis porttitor lacus a sem lacinia vestibulum nec quis neque.
Fusce sit amet porttitor sem. Nunc a laoreet est. Pellentesque facilisis dolor augue, sit amet aliquam justo vehicula quis. Pellentesque interdum a augue et convallis. Integer augue quam, consectetur at tortor quis, pulvinar gravida dolor. Praesent eu volutpat lacus. Integer risus nisi, venenatis non blandit vitae, feugiat ac ipsum. Etiam eu congue velit. </p></div>
<div id="grey-login">
<form id="usn">
Username: <input type="username" name="usn">
</form>
<form id="pwd">
Password: <input type="password" name="pwd">
</form>
<input type="submit" name="submit" value="Log In" id="submit" onclick="alert('Hello world!')"/>
</div>
</div>
</div>
</body>
</html>
And here is my CSS:
#charset "UTF-8";
/* CSS Document */
.container {
width: 1366px;
height: 1409px;
border: 2px solid black;
border-radius: 10px;
margin: auto;
positon: relative;
}
.div1 {
width: 1366px;
height: 253px;
background-color: black;
margin-top: -68px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
position: relative;
}
.div2 {
width: 1366px;
height: 591px;
background-color: white;
margin: none;
}
.div3 {
width: 1366px;
height: 550px;
background-color: #688E23;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
position: absolute;
z-index: 10;
}
#black-box {
width: 1278px;
height: 437px;
background-color: black;
border-radius: 15px;
position: absolute;
z-index: 20;
margin-top: 30px;
margin-left: 45px;
}
#black-box-text {
width: 730px;
height: 390px;
position: absolute;
z-index: 30;
color: white;
text-align: justify;
font-family: Arial,"Arial", Helvetica, sans-serif;
font-size: 24px;
margin-left: 470px;
padding-left: 10px;
padding-right: 45px;
overflow: auto;
}
#grey-login {
width: 387px;
height: 382px;
background-color: #cfcfcf;
background-image: url('images/login-image.jpg');
background-repeat: no-repeat;
background-position: 5% 5%;
border-radius: 15px;
margin-left: 30px;
margin-top: 25px;
position: relative;
}
#usn {
max-width: 175px;
margin-left: 205px;
padding-bottom: 10px;
padding-top: 20px;
position: relative;
z-index: 40;
text-align:center;
}
#pwd {
max-width: 175px;
margin-left: 205px;
padding-top: 20px;
padding-bottom: 10px;
position: relative;
z-index: 40;
text-align:center;
}
input[type=username] {
border: 1px solid #999;
border-radius: 7px;
height: 30px;
min-width: 150px;
max-width: 150px;
-webkit-appearance: none;
}
input[type=password] {
border: 1px solid #999;
border-radius: 7px;
height: 30px;
min-width: 150px;
max-width: 150px;
-webkit-appearance: none;
}
#submit {
background-color: #353535;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius:6px;
color: #fff;
font-family: 'Arial';
font-size: 20px;
text-decoration: none;
cursor: pointer;
border:none;
padding: 5px 20px;
margin-top: 20px;
margin-left: 150px;
}
#submit:hover {
border: none;
background: #DD1900;
box-shadow: 0px 0px 1px #777;
}
h1 {
font-family: Baskerville, Georgia, "Times New Roman", Times, serif;
color: #FFF;
font-size: 100px;
font-weight:100;
text-align:center;
margin-bottom:85px;
}
a {
text-decoration: underline;
font-family: Arial, Helvetica, sans-serif;
color: white;
text-align: center;
margin: 0 35px;
font-size: 22px;
padding-left: 50px;
padding-top: 50px;
}
.nav-style {
position: relative;
}
I am a noob at HTML and CSS, and some of the code in here I copied from other people when in a pinch. I need to submit this ASAP to a person I'm trying to get an internship with so a quick response would be very much appreciated. Thank you.
PS: I just discovered that the zoom option only messes up the link position in Chrome, but it did not occur when I tried it in Safari. I have not yet tried zooming in and out on IE to see how it works on there either. Here's a JSFiddle
Large screen and the zooming window are not same. Do not worry dude. Everything is ok..
you can define your width height etc. in terms of percentage or em

How can I get my hyperlink in HTML result in same page or window with or without using iframe tag or JavaScript?

Here are two html files and one css file. My question is how to open link monday.html on the same page or window in my section. i.e. when one click on mondy navigation button one get the result in content where lorem ipsum is shown.
/this is index.html file
<html>
<head>
<title>Navigation</title>
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
</head>
<body>
<div id="wrap">
<h1>Welcome to My page</h1>
<div id="content">
<h2>Lorem Ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis a felis. Sed ac mauris eget
eros vestibulum luctus. Phasellus ultrices consequat arcu. Aliquam rhoncus, elit nec faucibus
scelerisque, nisi ligula imperdiet dui, in lacinia nulla odio sit amet lorem. Praesent tristique,
orci ac posuere rhoncus, massa urna semper purus, et tempus justo massa a massa. Cras nec turpis
non massa lacinia facilisis. Phasellus gravida nisl eget metus. Fusce gravida, dui ac accumsan
sagittis, nisl quam interdum tortor, sed gravida risus lectus eget dui. Aliquam vitae justo ac
risus gravida convallis. Nulla quis diam a mi aliquam tempor. Duis dignissim erat vitae nisl.
Fusce vel lorem. Duis neque dolor, tempor nec, cursus id, convallis in, enim. Morbi egestas
lobortis neque.</p>
</div>
<div id="sidebar">
<h2>Weekdays</h2>
<ul>
<li>Monday</li>
<li>Tuesday</li>
<li>Wednesday</li>
<li>Thursday</li>
<li>Friday</li>
<li>Saturday</li>
<li>Sunday</li>
</ul>
</div>
<div id="footer">
<p>Copyright © MyPage</p>
</div>
</div>
</body>
</html>
my css code is as follows:-
/*
Mypage css file
*/
body {
margin: 0;
padding: 0;
background: #cfcdb4;
border-top: 10px solid #bcba9e;
font-family: Helvetica, sans-serif;
color: #fff;
}
p {
margin: 0 0 10px 0;
padding: 0;
line-height: 1.2em;
}
h2 {
margin: 0;
color: #6d8ead;
}
ul {
margin: 0;
padding: 0;
list-style-type: none;
}
#wrap {
margin: 0 auto;
width: 800px;
background: #362416;
border-left: 5px solid #281a0f;
border-right: 5px solid #281a0f;
}
#wrap h1 {
margin: 0;
padding: 10px;
text-align: center;
background: #553f2d;
border-bottom: 1px solid #362416;
color: #fff;
font-weight: normal;
font-family: Georgia, serif;
}
#content {
margin: 20px 0 0 0;
float: left;
width: 500px;
padding: 0 15px 0 15px;
}
#content h2 {
margin: 0 0 10px 0;
font-size: xx-large;
}
#sidebar {
float: right;
width: 260px;
margin: 20px 0 0 0;
}
#sidebar ul {
margin: 0 0 0 10px;
}
#sidebar ul li {
margin: 0 0 10px 0;
}
#sidebar h2 {
background: #553f2d;
margin: 0 0 10px 0;
padding: 5px;
}
#footer {
padding: 10px;
clear: both;
font-size: small;
}
#footer p {
margin: 0;
padding: 10px;
background: #281a0f;
text-align: center;
}
the hyperlink monday.html is as follows:-
<html>
<head>
<title>Monday</title>
</head>
<body>
This is a monday page
</body>
<html>
Most basic way I can think of is this using jquery.
$('#sidebar a').click(function(e){
e.preventDefault();
var location = $(this).attr('href');
$('#content').load(location);
});
However should most probably use a proper ajax or $.get function if you want more control
You will use AJAX to achieve this. Heres an awesome article below:
http://css-tricks.com/ajax-load-container-contents/