Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I think something is over riding the styling of my text but im not too sure what it is. In my code i have "#column-right" and "#column-right h1" and it is styling correctly. Now im trying to style the paragraphs text. I have "#full_width" and "#full_width p" however i cant get the p to style correctly. What is the problem with my code that is causing this issue?
UPDATE:
It should look like this: Screenshot 1
It looks like this: Screenshot 2
INB4: I will be pulling the style out into an external sheet after the build is done.
<!DOCTYPE html>
<html>
<head>
<style>
/** -------------------------------MAIN - DON'T EDIT---------------------------------- **/
html {
max-width:56em;
margin:0 auto;
padding:1.25em;
font:100% "Helvetica Neue",sans-serif;
color:#222;
background:#e2e7e8;
}
* {
margin: 0;
padding: 0;
}
.clear {
clear:both;
}
/** ---------------------------HEADER COLUMN LEFT------------------------------------- **/
#headermanager {
-webkit-box-shadow:0px 5px 10px #1c1c1c;
-moz-box-shadow:0px 5px 10px #1c1c1c;
box-shadow:0px 5px 10px #1c1c1c;
}
#column-left {
width: 230px;
float: left;
padding-top:20px;
padding-left:20px;
padding-bottom:20px;
background:rgba(255,255,255,0.75);
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.pic {
border: 10px solid #fff;
float: left;
height: 180px;
width: 180px;
overflow: hidden;
-webkit-box-shadow: 5px 5px 5px #111;
box-shadow: 5px 5px 5px #111;
}
.morphimg {
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
}
.morphimg:hover {
border-radius: 50%;
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
/** -------------------------------HEADER COLUMN CENTER------------------------------- **/
#column-center {
background:rgba(255,255,255,0.75);
width: 316px;
float: left;
padding-top:20px;
padding-left:20px;
padding-bottom:20px;
}
/** ---------------------------------HEADER COLUMN RIGHT------------------------------ **/
#column-right {
text-align:right;
background:rgba(255,255,255,0.75);
width: 310px;
float:right;
padding-top:20px;
padding-right:20px;
padding-bottom:20px;
}
#column-right h1 {
font-size:3em;
font-weight:200;
text-align:right;
width: 310px;
float:right;
}
#column-right h2 {
font-size:1.3em;
font-weight:100;
text-align:right;
width: 310px;
float:right;
}
#column-right h3 {
font-size:0.9em;
font-weight:200;
text-align:right;
width: 310px;
float:right;
}
#progress_bar {
background:rgba(255,255,255,0.75);
width: 310px;
}
/** -----------------------------------SECTION HEADERS-------------------------------- **/
#section_header {
background: #e94939;
padding: 1rem;
}
#section_header h1 {
font-size: 0.65em;
font-weight: 500;
letter-spacing: 0.35em;
text-transform: uppercase;
color: white;
text-align: center;
/** ---------------------------------------------------------------------------------- **/
/** -------------------------------------TEXT LAYOUTS--------------------------------- **/
/** ---------------------------------------------------------------------------------- **/
/** --------------------------------------ABOUT ME------------------------------------ **/
#full_width{
padding-left:7.8em;
padding-right:7.8em;
padding-top:2.85em;
padding-bottom:2.85em;
background:rgba(255,255,255,0.75);
}
#full_width p {
text-align:left;
font-size:0.8em;
font-weight:200;
}
</style>
</head>
<body>
<!--***********************************************************************************-->
<!--********************************* HEADER STARTS ***********************************-->
<!--***********************************************************************************-->
<!----------------------------------COLUMN LEFT STARTS----------------------------------->
<div id="column-left">
<div class="morphimg pic">
<img src="http://i50.tinypic.com/11r4nwh.png" alt="beach">
</div>
</div>
<!------------------------------- COLUMN CENTER STARTS ---------------------------------->
<div id="column-center">Social Hover</div>
<!----------------------------------COLUMN RIGHT STARTS---------------------------------->
<div id="headermanager">
<div id="column-right">
<h1>John Doe</h1>
<h2>lipsium ordium consecultar</h2>
<h3>www.jdoedesign.com<br>
me#jdoedesign.com<br>
256-220-8360<br>
141 Ritter Street Huntsville, AL 35816</h3>
</div>
<div class="clear"></div>
</div>
<div id="section_header">
<h1>Hello World</h1>
</div>
<div id="full_width">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dui
lorem, dictum non varius eget, accumsan ut tellus. Mauris sed nunc
vitae lectus egestas aliquam eu eu libero. Cras tempus euismod
interdum. Aenean rutrum orci nec mauris venenatis eu blandit est
eleifend. Cras elit magna, tempus eu luctus quis, dapibus et purus.
Suspendisse et quam ut est interdum porta. Morbi sed rhoncus risus.
Pellentesque eu libero justo, at varius purus. Duis faucibus ultrices
ipsum vitae eleifend. Suspendisse viverra congue dolor faucibus
feugiat. Etiam pulvinar congue tellus sit amet dapibus. Morbi et
ultricies diam. Suspendisse id vehicula lacus. Integer quis risus diam,
a facilisis justo.<br><br>Vestibulum ante ipsum primis in
faucibus orci luctus et ultrices posuere cubilia Curae; Sed lobortis
aliquet lorem, at placerat orci fermentum non. Nam ut tortor eu eros
gravida semper. Cras eget est ante. Sed vehicula justo et urna lacinia
volutpat. Vestibulum dolor ante, sollicitudin vel ultricies nec, mattis
non urna. Donec eget lorem ligula, quis ornare odio</p>
</div>
<!--***********************************************************************************-->
<!--******************************** ABOUT ME STARTS **********************************-->
<!--***********************************************************************************-->
<!--***********************************************************************************-->
<!--***************************** WORK EXPERIENCE STARTS ******************************-->
<!--***********************************************************************************-->
<!--***********************************************************************************-->
<!--******************************** EDUCATION STARTS *********************************-->
<!--***********************************************************************************-->
<!--***********************************************************************************-->
<!--***************************** TECHNICAL SKILLS STARTS *****************************-->
<!--***********************************************************************************-->
<!--***********************************************************************************-->
<!--********************************** AWARDS STARTS **********************************-->
<!--***********************************************************************************-->
<!--***********************************************************************************-->
<!--********************************** CONTACT STARTS *********************************-->
<!--***********************************************************************************-->
</body>
</html>
you forgot your closing }
#section_header h1 {
font-size: 0.65em;
font-weight: 500;
letter-spacing: 0.35em;
text-transform: uppercase;
color: white;
text-align: center;
/* } Was not placed */
Take a look at this fiddle
Your #section_header h1 selector is missing its closing bracket.
Use the following selector for specificity:
#full_width > p {
/*myStyles*/
}
With this, you will select all paragraphs inside the full_width div.
Related
I used this footer on my homepage and it worked fine, but copy and pasting it over to another webpage completely destroyed all the styling it had, which is weird, because the header (which I also copied from the same page) is completely fine and unchanged. Any thoughts? Here's a fiddle with all the code:
Okay, so I just put it into the fiddle and it worked fine, but it still doesn't work like it should when I open it in Chrome through Sublime Text.
Here's all the code:
HTML
<body>
<div class="header">
<div class="navbar">
<p class="navwords nonactive">Home</p>
<p class="navwords active">Our Team</p>
<p class="navwords nonactive">Weddings</p>
<p class="navwords nonactive">Events</p>
<p class="navwords nonactive">Contact</p>
</div>
<div class="headerlogo">
<a src="#"><img id="background" src="assets/BlurryFlowers.png"></a>
<img id="logo" src="assets/Logo.png">
</div>
</div>
<div class="ourteam">
<div class="employee" id="brax">
<h2>Brax</h2>
<img src="assets/Braxpic.png">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae arcu quis risus elementum auctor in eu erat. Nullam sodales pulvinar eros, semper euismod elit pretium sit amet. Vestibulum vestibulum libero id ipsum viverra, condimentum vulputate urna volutpat. In lobortis sit amet risus id vehicula. Praesent in risus at urna mollis eleifend vel et arcu. Quisque urna leo, porta non turpis sit amet, gravida sagittis erat. Curabitur eu convallis purus. Vestibulum feugiat purus ac urna aliquet rutrum.</p>
</div>
<div class="employee" id="ryan">
<h2>Ryan</h2>
<img src="assets/Ryanpic.png">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae arcu quis risus elementum auctor in eu erat. Nullam sodales pulvinar eros, semper euismod elit pretium sit amet. Vestibulum vestibulum libero id ipsum viverra, condimentum vulputate urna volutpat. In lobortis sit amet risus id vehicula. Praesent in risus at urna mollis eleifend vel et arcu. Quisque urna leo, porta non turpis sit amet, gravida sagittis erat. Curabitur eu convallis purus. Vestibulum feugiat purus ac urna aliquet rutrum.</p>
</div>
</div>
<div class="footer">
<div class="favicon">
<img id="favicon" src="assets/favicon.png">
</div>
<div class="footernav">
<p>Home</p>
<p>Our Team</p>
<p>Weddings</p>
<p>Events</p>
<p>Contact</p>
</div>
<div class="socialmedia">
<img class="social" src="assets/facebook.png">
<a class="socialText" href="https://www.facebook.com/yourstorybookmemory/"><p>Storybook Memories</p></a><br/>
<img class="social" src="assets/instagram.png">
<a class="socialText" href="https://www.instagram.com/yourstorybookmemory/"><p>yourstorybookmemory</p></a><br/>
<img class="social" src="assets/twitter.png">
<a class="socialText" href="https://twitter.com/sbvideography"><p>#sbvideography</p></a><br/>
<img class="social" src="assets/youtube.png">
<a class="socialText" href="https://www.youtube.com/channel/UCcMVbKyDIJN0Ht-6VjDiFKA"><p>Storybook Memories</p></a><br/>
<img class="social" src="assets/mail.png">
<a class="socialText" href="mailto:inquiries#yourstorybookmemory.com"><p>inquiries#yourstorybookmemory.com</p></a><br/>
</div>
</div>
</body>
CSS
/* PAGE SETUP */
*{
font-weight: 100;
}
body {
font-family: 'Lato', 'sans-serif';
width: 100%;
margin: 0px;
}
/* HEADER FOR ALL PAGES */
.header {
width: 100%;
}
.headerlogo {
top: 0;
left: 0;
position: relative;
}
#background {
width: 100%;
z-index: 2;
}
#logo {
z-index: 1;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar {
width: 100%;
background-color: rgba(96,150,38,0.4);
text-align: right;
position: absolute;
height: 55px;
top: 0;
left: 0;
z-index: 3;
}
.nonactive {
color: white;
}
.active {
color: black;
cursor: ;
}
.navwords {
display: inline-block;
margin: 15px;
vertical-align: middle;
font-size: 1em;
transition: .3s color;
font-weight: 300;
cursor: pointer;
}
.navwords:hover {
color: black;
}
/* OUR TEAM SECION */
/* FOOTER SECTION */
.footer {
background-color: #5c0e13;
color: white;
display: inline-block;
width: 100%;
}
.favicon, .footernav, .socialmedia {
float: left;
}
.favicon {
margin-left: 1%;
margin-top: 1%;
margin-right: 1%;
}
.footernav a {
text-decoration: none;
color: white;
transition: .3s color;
}
.footernav a:hover {
color: #db1421;
}
.socialmedia {
margin-left: 50%;
position: relative;
transform: translateY(10%);
}
.socialmedia p {
margin: 6px;
padding: 0;
}
.social {
width: 20px;
margin-right: 10px;
vertical-align: middle;
}
.socialmedia a {
text-decoration: none;
color: white;
transition: .3s color;
vertical-align: middle;
}
.socialmedia a:hover {
color: #db1421;
}
.socialText{
display:inline-block;
}
EDIT: Here is a screenshot of what it's doing right now:
And here is a fiddle with an example of it working (sort of, that maroon background means it's working, because that's not working on the screenshot).
https://jsfiddle.net/f26w8boe/
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.
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
}
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
For a small project, I need this little website that pulls data from a server via AJAX and outputs it like shown in this picture. However the problem isn't JavaScript, but pure HTML+CSS..
You can take a look at this page via jsfiddle by clicking this, or you can take a look at the quoted code that is quoted by the end of this post: http://jsfiddle.net/RdJUM/
The list is build with the following html snippet:
<div id="update">
<ul class="searchresults">
<li>
<h2>Caption</h2>
<div>
<img src="" alt="" />
<p>Text</p>
</div>
</li>
</ul>
</div>
It is formatted via CSS, but the important part is this:
#update ul li {
height: 110px;
overflow: hidden;
/* ... */
/*
-webkit-transition: height 0.3s ease-out;
-moz-transition: height 0.3s ease-out;
-o-transition: height 0.3s ease-out;
transition: height 0.3s ease-out;
*/
}
#update li:hover {
height: auto;
}
This works fine as long as you leave the transitions commented out. You hover on the article and it will scale the height to "auto" which gives exactly the height of your content and nothing more. However if you uncomment the transistions, WebKit (Chrome 30, Safari 6) do a really shaky effect that is completely unusable. For convenience this is the jsfiddle link to the uncommented version: http://jsfiddle.net/bQZ7F/
In Firefox 23 and Opera 12 this transition is deactivated, so it will behave as if the CSS part wasn't there.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Live Search</title>
<link rel="stylesheet" href="mystyle.css" />
</head>
<body>
<div id="searcharea">
<label for="search">live search</label>
<p>Enter the name or info about a speaker</p>
<input type="search" name="search" id="search" placeholder="name or info" />
</div>
<div id="update">
<ul class="searchresults">
<li>
<h2>Lorem Ipsum</h2>
<div>
<img src="http://placehold.it/80x80" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer semper dui sit amet erat faucibus egestas. Vivamus eget commodo ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ac magna metus. Donec eget auctor lorem. Cras vehicula nulla quis facilisis ultrices. Duis bibendum tellus ut porta suscipit. Pellentesque vitae orci a orci tincidunt posuere at et quam. Aliquam erat volutpat. Etiam dignissim egestas arcu non lacinia. Sed placerat sagittis enim eget bibendum. Suspendisse mollis consequat libero, ut porttitor eros consequat vitae. Mauris dolor nunc, ultrices eu leo sed, ornare lacinia quam. Pellentesque convallis massa at massa egestas, vestibulum vulputate dolor dignissim. Nullam sed metus a odio convallis molestie non a nisl. Donec eleifend lacus ut suscipit cursus. Cras viverra urna at arcu lacinia, in viverra neque pharetra. Suspendisse pellentesque tortor sit amet lacus elementum gravida et non risus. In cursus turpis vitae tortor molestie congue. Phasellus laoreet sit amet neque sit amet egestas. Aliquam sagittis ac massa vitae pulvinar. Vivamus bibendum odio sed enim porta pretium. Ut varius lacinia elit ut interdum. In in pretium metus.</p>
</div>
</li>
<li>
<h2>Lorem Ipsum</h2>
<div>
<img src="http://placehold.it/80x80" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer semper dui sit amet erat faucibus egestas. Vivamus eget commodo ante.</p>
</div>
</li>
<li>
<h2>Lorem Ipsum</h2>
<div>
<img src="http://placehold.it/80x80" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer semper dui sit amet erat faucibus egestas. Vivamus eget commodo ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis ac magna metus. Donec eget auctor lorem. Cras vehicula nulla quis facilisis ultrices. Duis bibendum tellus ut porta suscipit. Pellentesque vitae orci a orci tincidunt posuere at et quam. Aliquam erat volutpat. Etiam dignissim egestas arcu non lacinia. Sed placerat sagittis enim eget bibendum. Suspendisse mollis consequat libero, ut porttitor eros consequat vitae.</p>
</div>
</li>
<li>
<h2>Caption</h2>
<div>
<img src="" alt="" />
<p>Text</p>
</div>
</li>
</ul>
</div>
</body>
</html>
CSS:
/* #override
http://localhost/~simon/tests/ajax_search/mystyle.css */
body {
background: #DAD7C7;
}
#searcharea {
margin: 0 auto;
text-align: center;
background: #BF996B;
padding: 10px;
width: 30%;
-webkit-border-radius: 10px 10px 0 0;
-moz-border-radius: 10px 10px 0 0;
border-radius: 10px 10px 0 0;
}
#searcharea label {
font: bold 1.3em Arial;
text-transform: uppercase;
padding-bottom: 5px;
color: #A61C1C;
}
#searcharea p {
margin: 0;
line-height: 1em;
padding-bottom: 5px;
}
#searcharea input {
width: 80%;
text-align: center;
}
#update {
font-family: Georgia, "Times New Roman", Times, serif;
width: 70%;
margin: 0 auto;
border-top: 1px dotted #CCC;
}
#update ul {
list-style: none;
margin: 0;
padding: 0;
}
#update ul li {
width: 100%;
padding: 0 20px 20px;
background: #EEE;
height: 110px;
overflow: hidden;
border-bottom: 1px dotted #CCC;
-webkit-animation: myanim 1s;
-moz-animation: myanim 1s;
-o-animation: myanim 1s;
animation: myanim 1s;
-webkit-transition: height 0.3s ease-out;
-moz-transition: height 0.3s ease-out;
-o-transition: height 0.3s ease-out;
transition: height 0.3s ease-out;
}
#update li:hover {
background: #FFFCE5;
height: auto;
}
#update ul li div {
margin: 0;
padding: 0;
}
#update ul li div p {
margin: 0;
}
#update h2 {
margin: 0;
padding: 0;
font-size: 1.2em;
padding-bottom: 5px;
padding-top: 20px;
font-family: Arial, Helvetica, sans-serif;
color: #BF5841;
border-bottom: 1px dotted #CCC;
margin-bottom: 10px;
}
#update img {
float: left;
width: 80px;
margin-right: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
#-webkit-keyframes myanim {
0% { opacity: 0.3; }
100% { opacity: 1.0; }
}
#-moz-keyframes myanim {
0% { opacity: 0.3; }
100% { opacity: 1.0; }
}
#-o-keyframes myanim {
0% { opacity: 0.3; }
100% { opacity: 1.0; }
}
#keyframes myanim {
0% { opacity: 0.3; }
100% { opacity: 1.0; }
}
Thanks for the hint, seems that it isn't possible without using JavaScript:
Set CSS to these values
#update ul li {
height: 110px;
/* ... */
}
#update li:hover {
background: #FFFCE5;
}
Principle of JavaScript code:
// Mouse-enter Event
curHeight = $(this).height();
autoHeight = $(this).css('height', 'auto').height();
$(this).height(curHeight).animate({height: autoHeight}, 1000);
// Mouse-leave Event
// same, but vice versa
You can grab the full code here: http://jsfiddle.net/9eaAq/