Hey I'm currently working on a responsive web design for school and it is a disaster. Currently setting up the website before making it responsive and the text and images aren't going where I need them to go. This is my coding for css so far:
body{
background-color: #cd76dd;
font-family: 'Raspoutine Medium';
color:white;
}
#page-wrap{
width: 950px;
margin: 0 auto;
}
#containerIntro h1{
font-family: 'AlphaClouds';
background-color: #7ac8ff;
color:white;
font-size: 45px;
width: 100%;
padding-bottom: 10px;
position: static;
bottom: 0;
left: 0;
}
#containerIntro p{
font-family: 'AlphaClouds';
background-color: #7ac8ff;
color:white;
text-align: left;
font-size: 70px;
width: 100%;
}
h1: hover{
text-shadow: 0px 0px 20px white;
}
h1 p: hover{
text-shadow: 0px 0px 20px white;
}
h1{
position: absolute;
left: 0;
bottom: 0;
}
p{
background-color:#ffa1ff;
color:white;
text-align: left;
padding-top: 20px;
padding-bottom: 20px;
padding-left: 10px;
font-size: 17px;
width: 450px;
height: 100%;
}
h2{
background-color: #ffa1ff;
color:white;
text-align: left;
padding-top: 20px;
padding-left: 10px;
font-size: 20px;
border: 2px #ffa1ff solid;
width: 450px;
height: 100%;
}
h3{
background-color: #ffa1ff;
color:white;
text-align: left;
font-size: 20px;
padding-left: 10px;
border: 2px #ffa1ff solid;
width: 450px;
height: 100%;
}
.gummy{
float: right;
}
.bubble{
float: right;
position: relative; right: -130px;
padding-top: 15px;
}
.pink{
float: left;
position: relative; top: -145px;
}
.blue{
float: right;
position: relative; top: -145px;
}
p.select{
background-color: #5d75ed;
text-align: right;
padding-bottom:10px;
padding-top: 10px;
font-size: 17px;
width: 170px;
float: right;
margin-top: -850px;
}
p.archives{
background-color: #f9e075;
text-align: right;
padding-bottom: 10px;
padding-top: 10px;
padding-left: 10px;
font-size: 17px;
width: 170px;
float: right;
margin-top: -600px;
}
p.resources{
background-color: #ef5b66;
padding-bottom: 10px;
padding-top: 10px;
font-size: 17px;
width: 170px;
float:right;
margin-top: -500px;
}
div{
height: 287;
width: 198;
}
mock up for what it will look like
Inside of #containerIntro h1, you don't need to add position: static due to that being already set by default. Plus if an element is static, direction properties such as bottom, top, left, and right are completely ignored.
Try to use the property called clear and set it to both...
p {
clear: both;/*Element should have no other elements on the left and right side*/
}
clear:both; gets rid of floating objects on both the left and right sides of an element. I hope this helps!
Related
I can't get the text box at the bottom to appear over the image without messing up the navigation bar
https://imgur.com/a/n2lfl57
I've tried all sorts of things and the text either just doesn't move the way I expect or messes up my navbar as I said
I'd be extremely happy if someone could help as I need to finish this in a few days for school.
here's my css code
body{
margin: 0px;
padding: 0px;
height: 100%;
}
header{
margin-bottom: -20px;
padding: 0px;
overflow: hidden;
}
footer{
background-color: black;
margin-top: : -5px;
padding: 0px;
}
.bgimage{
margin-bottom: -5px;
width: 1920px;
}
.container{
}
.imgtext{
border-style: solid;
color: white;
bottom: 20px;
right: 20px;
background-color: black;
color: white;
padding-left: 20px;
padding-right: 20px;
}
.YeStage{
margin: 0px;
padding: 0px;
width: 1920px;
height: 700px;
object-fit: cover;
}
.menu {
margin-top: : -20px;
ma
padding: 0px;
background-color: #3b1113;
overflow: hidden;
list-style-type: none;
position: sticky;
top: 0;
margin-bottom: 0
border:0;
}
.Logo {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 0px
margin-bottom: 0px
width: 440px;
height: 50px;
}
.menu a {
float: left;
color: #FFFF;
text-align: center;
padding: 36px 38px;
text-decoration: none;
font-size: 17px;
}
.menu a:hover {
background-color: #f5bd0e;
color: black;
}
.menu a.active {
background-color: #f5bd0e;
color: black;
}
Good day,
In my web page designed for smartphones, I have added a footer as shown in the screenshot and in the extracted html code below (I have extracted the relevant part of the code in order to avoid to annoy you). I am trying to have the blue ribbon extended up to the left hand side margin.
Any idea what I am missing here ?
Many thanks for your help. Happy Easter Monday.
HTML code :
<!DOCTYPE html>
<html>
<head>
...
<div class="footer" id="footer">Domoosweb mobile version 0.0.1 </div>
</body>
</html>
CSS code :
#tag_domoos_title{
font-family:Arial;
font-size: 150%;
text-align: left;
position: absolute;
top: 5px;
left: 130px;
color:blue;
z-index:10;
font-weight: 900;
}
#tag_update{
font-family:Arial;
font-size: 90%;
text-align: left;
position: absolute;
top: 20px;
left: 90px;
color:blue;
}
#datetime{
font-family:Arial;
font-size: 90%;
text-align: left;
position: absolute;
top: 40px;
left: 130px;
color:blue;
}
#tag_sunrise_sunset{
font-family:Arial;
font-size: 80%;
text-align: left;
position: absolute;
top: 50px;
left: 50px;
color:black;
}
#tag_weather_temperature{
font-family:Arial;
font-size: 100%;
text-align: right;
position: absolute;
top: 145px;
right: 15px;
color:black;
font-weight: 900;
}
#current_weather_conditions_title{
font-family:Arial;
font-size: 95%;
text-align: left;
position: absolute;
top: 110px;
left: 10px;
color:blue;
font-weight: 900;
}
#current_weather_forecast_title{
font-family:Arial;
font-size: 95%;
text-align: left;
position: absolute;
top: 200px;
left: 10px;
color:blue;
font-weight: 900;
}
#tag_weather_condition{
font-family:Arial;
font-size: 90%;
text-align: left;
position: absolute;
top: 130px;
left: 10px;
color:black;
font-weight: 600;
}
#tag_additional_weather_information{
font-family:Arial;
font-size: 90%;
text-align: center;
position: absolute;
top: 150px;
left: 10px;
width: 250px;
color:black;
}
#meteo_icon {
position: absolute;
right: 10px;
top: 100px;
}
#meteo_forecast{
font-family:Arial;
font-size: 100%;
float:left;
padding-top: 5px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 10px;
height:434px;
width:870px;
top:200px;
position: relative;
}
#meteo_forecast_day1{
font-family:Arial;
font-size: 80%;
text-align: left;
position: absolute;
top: 215px;
left: 10px;
color:black;
font-weight: 600;
}
#meteo_forecast_day2{
font-family:Arial;
font-size: 80%;
text-align: left;
position: absolute;
top: 285px;
left: 10px;
color:black;
font-weight: 600;
}
#meteo_forecast_day3{
font-family:Arial;
font-size: 80%;
text-align: left;
position: absolute;
top: 355px;
left: 10px;
color:black;
font-weight: 600;
}
#meteo_forecast_temperature_day1{
font-family:Arial;
font-size: 80%;
text-align: right;
position: absolute;
top: 215px;
right: 5px;
color:black;
}
#meteo_forecast_temperature_day2{
font-family:Arial;
font-size: 80%;
text-align: right;
position: absolute;
top: 285px;
right: 5px;
color:black;
}
#meteo_forecast_temperature_day3{
font-family:Arial;
font-size: 80%;
text-align: right;
position: absolute;
top: 355px;
right: 5px;
color:black;
}
#meteo_forecast_condition_day1{
font-family:Arial;
font-size: 80%;
text-align: left;
position: absolute;
top: 235px;
left: 10px;
color:black;
}
#meteo_forecast_condition_day2{
font-family:Arial;
font-size: 80%;
text-align: left;
position: absolute;
top: 305px;
left: 10px;
color:black;
}
#meteo_forecast_condition_day3{
font-family:Arial;
font-size: 80%;
text-align: left;
position: absolute;
top: 375px;
left: 10px;
color:black;
}
#domoos_logo {
position: absolute;
left: 50px;
top: 0px;
}
#lorem{
font-family:Arial;
font-size: 100%;
text-align: left;
position: absolute;
top: 100px;
left: 10px;
height: auto;
}
#footer
{
font-family:Arial;
font-size: 40%;
clear: both;
border: 1px groove #aaaaaa;
background: blue;
color: White;
padding: 0;
text-align: center;
vertical-align: middle;
line-height: normal;
margin: 0;
position: fixed;
bottom: 0px;
width: 100%;
}
#hyperlinks_mobile
{
font-family:Arial;
font-size: 80%;
text-align: center;
position: absolute;
top: 500px;
left: 10px;
color:black;
}
ul {
background: #bbb;
}
li, [class*="grid"] > * {
background: #ccc;
}
header, footer {
background: #ddd;
}
body {
background-color:#ddd;
}
progress[value] {
/* Reset the default appearance */
-moz-appearance: none;
appearance: none;
/* leave defaults in for other browsers */
background-size: 35px 20px, 100% 100%, 100% 100%;
color:purple;
}
progress[value]::-webkit-progress-value {
background-color: purple;
}
Add left:0; to #footer. See the following (minimized) solution:
#footer {
font-family:Arial;
font-size: 40%;
clear: both;
border: 1px groove #aaaaaa;
background: blue;
color: White;
padding: 0;
text-align: center;
vertical-align: middle;
line-height: normal;
margin: 0;
position: fixed;
bottom: 0px;
left:0;
width: 100%;
}
body {
background-color:#ddd;
}
<!DOCTYPE html>
<html>
<head></head>
<body>
<div class="footer" id="footer">Domoosweb mobile version 0.0.1</div>
</body>
</html>
Just update your #footer CSS with following CSS
#footer {
left: 0;
position: fixed;
bottom: 0px;
}
I suspect the default value for the body is causing you problems. Different browsers have different default values for certain things. Try a reset of the body declarations by putting this on line 1 of your css:
body {
margin: 0;
padding: 0;
}
In most browsers, the default margin is 8px.
If you want to change it, you can just do this:
1) Set left: 0px at #footer
#footer
{
...
left:0px; /* add this line */
}
or
2) Set margin: 0px at body
body {
background-color:#ddd;
margin: 0px; /* add this line */
}
As per your HTML and CSS codes #footer is positioned as fixed,
Position - fixed - Do not leave space for the element. Instead,
position it at a specified position relative to the screen's viewport
and don't move it when scrolled.
So whenever a element is position as fixed or absolute, you will often find some spacing at left side, that's because when elements are positioned like this there top, left, right and bottom values are initialized as auto, so easy fix is to check if you have added margin:0 to body or add left as 0.
#footer{
font-family:Arial;
font-size: 40%;
clear: both;
border: 1px groove #aaaaaa;
background: blue;
color: White;
padding: 0;
text-align: center;
vertical-align: middle;
line-height: normal;
margin: 0;
position: fixed;
bottom: 0px;
width: 100%;
left:0;
}
<div class="footer" id="footer">Domoosweb mobile version 0.0.1 </div>
Or
body{
margin:0;
}
#footer{
font-family:Arial;
font-size: 40%;
clear: both;
border: 1px groove #aaaaaa;
background: blue;
color: White;
padding: 0;
text-align: center;
vertical-align: middle;
line-height: normal;
margin: 0;
position: fixed;
bottom: 0px;
width: 100%;
}
<div class="footer" id="footer">Domoosweb mobile version 0.0.1 </div>
Okey so when I shrink my chrome window the Nav and the Header moves with the rezising. I don´t want that. The Mainbox however stays in position? No idea why but great! I can´t really find the difference between the Nav class and the Mainbox one except the overflow: auto which didn´t help on the nav nor the header.
.container {
height: 800px;
width: 1500px;
}
body {
margin:0px;
padding:0px;
width:100%;
}
header
{
top: 11px;
width: 100%;
}
ol {
list-style-type: upper-roman;
}
.sideIMG {
position:fixed;
top: 200px;
left: 500px;
height: 100%;
float: left;
}
.sideIMGR {
position:absolute;
top: 200px;
right: 20%;
height: 100%;
float: left;
overflow: auto;
}
.mainBox
{
background-color: #F0F0F0 ;
height: 1050px;
width: 700px;
box-shadow: 10px 10px 5px #888888;
overflow: auto;
top: 310px;
padding-top: 30px;
padding-right: 50px;
padding-left: 50px;
}
.textBox
{
height: 110px;
width: 200px;
background-color:#E8E8E8;
border-style: double;
}
H1{
font-family:"Brush Script MT";
}
footer
{
box-shadow: 10px 10px 5px #888888;
border-bottom-right-radius: 20px;
border-bottom-left-radius: 20px;
top: 1360px;
height: 150px;
width: 800px;
background-color: #F0F0F0 ;
}
.container nav ul {
list-style-type: none;
}
nav
{
padding: 10px 20px 20px 20px;
padding-right: 50px;
padding-left: 50px;
box-shadow: 10px 10px 5px #888888;
width: 700px;
height:40px;
background-color: #F0F0F0;
border-color: black;
border-width: 1px;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
font-family: Georgia, "Times New Roman", Times, serif;
}
a {
color: #000;
text-decoration: none;
padding: 20px;
}
a:hover
{
color:#00A0C6;
text-decoration:none;
cursor:pointer;
}
.bildRuta
{
height: 350px;
width: 250px;
left: 500px;
top: 350px;
}
.mainBox a img {
border: medium solid #000;
border-radius: 5px;
}
.underRubrik
{`enter code here`
font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
}
HTML:
<center><header><img src="Bilder/spegel.jpg"/></header></center>
I'm racking my brain over here, trying to find a way for my divs to stay together when page re-sizing happens. (I made all the colored lines on the page as divs, except for the two vertical and the long horizontal on bottom. That's part of a border). Also for the Title/Menu/Rest-of-the-page to stay cohesive.
A step-by-step would be very appreciated, as I'm kinda new to html and css, and my site is live. You can check it out for hands-on (instead of combing through the code/css I pasted) at http://www.yamatat.com
I'm trying to make the default size at 1366 x 768, as that's that size has the most global share right now.
Here's my html:
<title>You And Me And Thoughts And Talk with Doug Culp</title>
</head>
<div class="page-title-container">
<div id="orangeone"></div>
<div id="blueone"></div>
<div class="page-title">YOU AND ME AND THOUGHTS AND TALK WITH DOUG CULP</div>
<div id="orangetwo"></div>
<div id="bluetwo"></div>
<div id="bluethree"></div>
<div id="bluefour"></div>
<div id="bluefive"></div>
<nav>
<a id="home" class="menu" href="http://www.yamatat.com/index.html">HOME</a>
<a id="podcast" class="menu" href="http://www.yamatat.com/podcast.html">PODCAST</a>
<a id="media" class="menu" href="http://www.yamatat.com/media.html">MEDIA</a>
<a id="blog" class="menu" href="http://www.yamatat.com/blog.html">BLOG</a>
<a id="shows" class="menu" href="http://www.yamatat.com/shows.html">SHOWS</a>
</nav>
</div>
<body>
<h1 class="home_news"><span>NEWS STUFF//</span></h1>
<div id="underline_news"></div>
<div id="news"><span id="news_date">12/24/2013</span>
<p>It's been a wild ride so far. I'm writing this before the site goes live. You guys don't even know!! I learned how to make my own page so that I could make it and put it out for you guys, the listeners. The YAMATATers. Scalloped, baked, french
fried. Any way you want it, THAT's the way you need it. It's 5:20 am. I should really get to bed. Merry Christmas Eve everyone!!</p>
</div>
<a class="twitter-timeline" width="400" height="450" data-dnt="true" href="https://twitter.com/dougathan" data-widget-id="416479074542817280">Tweets by #dougathan</a>
<script>
! function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + "://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
}
}(document, "script", "twitter-wjs");
</script>
</body>
</html>
And here's my css:
.page-title-container {
min-width: 85.375em;
}
h1 {
font-size: 60px;
color: #00BFFF;
text-align: center;
border-width: 10px;
border-radius: 6px;
margin-left: 45px;
margin-right: 45px;
font-family: 'Dosis', sans-serif;
padding-bottom: 0px;
margin-top: -20px;
}
.page-title {
font-size: 60px;
color: #00BFFF;
text-align: center;
border-width: 10px;
border-radius: 6px;
margin-left: 238px;
margin-right: 0px;
font-family: 'Dosis', sans-serif;
padding-bottom: -10px;
padding-top: 25px;
margin-top: -64px;
border-style: solid solid solid solid;
border-color: orange;
width: 1410px;
float: left;
font-weight: bold;
line-height: 55px;
}
a.menu:hover {
color: orange;
}
a:hover {
color: orange;
}
a:hover .body_link {
color: orange;
text-decoration: none;
}
#orangeone {
height: 10px;
width: 255px;
border-radius: 6px;
background-color: orange;
float: left;
margin-left: -8px;
margin-top: -15px;
position: relative;
}
#orangetwo {
height: 10px;
width: 255px;
border-radius: 6px;
background-color: orange;
float: right;
margin-right: 0px;
margin-top: -61px;
position: relative;
}
#orangethree {
height: 62px;
width: 10px;
background-color: orange;
float: left;
margin-left: -5px;
margin-top: 0px;
border-radius: 6px;
position: relative;
}
#orangefour {
height: 62px;
width: 10px;
background-color: orange;
float: right;
margin-right: 0px;
margin-top: 0px;
border-radius: 6px;
position: relative;
}
#orangefive {
height: 10px;
width: 1423px;
background-color: orange;
float: left;
margin-left: 240px;
margin-top: 0px;
border-radius: 6px;
position: relative;
}
#blueone {
height: 10px;
width: 240px;
background-color: #00bfff;
border-radius: 6px;
margin-left: -8px;
margin-top: 15px;
position: relative;
}
#bluetwo {
height: 10px;
width: 245px;
background-color: #00bfff;
border-radius: 6px;
margin-right: 0px;
margin-top: -46px;
float: right;
position: relative;
}
#bluethree {
height: 100px;
width: 10px;
background-color: #00bfff;
float: left;
margin-left: 222px;
margin-top: -40px;
border-radius: 6px;
position: relative;
}
#bluefour {
height: 100px;
width: 10px;
background-color: #00bfff;
float: right;
margin-right: 235px;
margin-top: -40px;
border-radius: 6px;
position: relative;
}
#bluefive {
height: 10px;
width: 1460px;
background-color: #00bfff;
float: center;
margin-left: 223px;
border-radius: 6px;
margin-top: 87px;
position: relative;
}
a.menu {
text-decoration: none;
float: top;
font-size: 46px;
color: black;
position: absolute;
font-family: 'Dosis', sans-serif;
margin-top: 0px;
}
#home {
margin-top: -66px;
margin-left: 400px;
}
#podcast {
margin-top: -66px;
margin-left: 600px;
}
#media {
margin-top: -66px;
margin-left: 890px;
}
#blog {
margin-top: -66px;
margin-left: 1125px;
}
#shows {
margin-top: -66px;
margin-left: 1350px;
}
.home_news, .home_pod {
font-family: Tahoma;
font-size: 55px;
color: black;
margin-top: 25px;
border-bottom: solid 10px black;
text-align: left;
display: inline;
border-radius: 0px;
position: relative;
margin-left: 40px;
}
.home_news span {
position: relative;
top: 12px;
}
.home_pod span {
position: relative;
top: 12px;
}
#news_date {
float: left;
font-weight: bold;
font-size: 30px;
margin-top: -20px;
margin-left: 0px;
}
#news {
float: left;
font-size: 24px;
margin-left: 40px;
margin-top: 105px;
width: 650px;
white-space: normal;
word-wrap: break-word;
}
.home_pod {
position: relative;
top: 12px;
font-family: Tahoma;
font-size: 55px;
color: black;
text-align: left;
margin-left: 40px;
}
#pod_date {
font-weight: bold;
font-size: 30px;
}
#pod {
font-size: 24px;
margin-top: 105px;
width: 650px;
white-space: normal;
word-wrap: break-word;
margin-left: 45px;
}
.twitter-timeline {
float: right;
margin-right: 10px;
margin-top: 25px;
}
a#Eegg_1 {
float: left;
margin-left: 35px;
margin-top: -110px;
}
#Eegg_1_expl {
float: left;
color: black;
display: block;
margin-top: 155px;
margin-left: -287px;
font-size: 18px;
}
a#youtube_link {
float: right;
margin-right: 210px;
margin-top: -5px;
}
a:hover #youtube_small {
float: right;
}
#bloggy_head {
float: left;
text-decoration: none;
margin-left: 800px;
margin-top: 50px;
}
#bloggy_doit {
float: left;
font-family: Courier;
font-size: 70px;
margin-left: 745px;
margin-top: 50px;
font-weight: bold;
}
.body_link {
color: black;
text-decoration: none;
}
.home_shows {
font-family: Tahoma;
font-size: 55px;
color: black;
margin-top: 25px;
float: left;
}
#underline_shows {
height: 10px;
width: 275px;
background-color: black;
float: left;
margin-left: -323px;
margin-top: 85px;
}
#show_calendar {
float: left;
font-size: 24px;
margin-left: -320px;
margin-top: 105px;
width: 650px;
white-space: normal;
word-wrap: break-word;
}
You could do this much simpler with a bookend design using images.
For example:
[Bookend Left Image][Title + Nav Div with flexible width and background][Bookend Right Image]
Sorry for a weird title but I don't really know how to describe it easily.
First I'll link my JSFiddle on it http://jsfiddle.net/b7YTd/
When I added the "float: left" and "float: right" the rows jumped outside the box and the box doesn't expand as the content gets "larger".
My question is, how do I make the box expand after the content like it should do with content inside it if it doesn't have a set height?
In order to post my JSFiddle I need to add some code so my CSS:
#profile_friends {
margin-top: 15px;
margin-left: -10px;
background: rgb(240,240,240);
border: 2px solid #555;
border-radius: 3px;
width: 100%;
}
.friend_left {
float: left;
width: 250px;
}
.friend_right {
float: right;
width: 250px;
}
.friend img {
width: 50px;
height: 50px;
float: left;
margin-left: 15px;
margin-right: 8px;
}
.friend ul {
list-style-type: none;
margin-top: -15px;
margin-left: 35px;
}
#profile_friends h4 {
margin: 0;
padding: 0;
text-align: center;
text-transform: uppercase;
color: rgb(110,110,110);
font-weight: bold;
height: 20px;
}
#profile_friends hr {
margin: 0;
padding: 0;
}
If I understand you correctly use:
#friendlist {
overflow: auto;
}
http://jsfiddle.net/b7YTd/1/
I had this issue, but used overflow:hidden; on the parent div.
http://jsfiddle.net/b7YTd/3/
#profile_friends {
margin-top: 15px;
margin-left: -10px;
background: rgb(240,240,240);
border: 2px solid #555;
border-radius: 3px;
width: 100%;
overflow:hidden;
}