Overflow text box adds white space on bottom of page - html

I'm not really sure how to explain this, as I'm still new to coding, but I am attempting to make a profile layout for HEX, and I keep having this issue come up on every one I make:
I noticed that when I edit my scrollbox, the white space changes its size accordingly. The bigger the scroll box, the bigger the space and vice versa. Here's the code to my last profile:
body {
background-image: url(http://i.imgur.com/X3qmTN2.png);
background-repeat: no-repeat;
background-attachment: scroll;
height: 100px;
padding-bottom: 0;
font-family: Arial, sans-serif;
color: #e80812;
text-alignment: justify;
}
#nav {
width: 400px;
line-height: 80px;
padding-top: 670px;
}
#nav a:link, #nav a:visited, #nav a:active {
display: block;
font: 14px "arial";
text-transform: uppercase;
text-decoration: none;
text-align: center;
letter-spacing: 2px;
color: #ab4860;
padding: 7px;
-webkit-transition: all .5s ease-out;
-moz-transition: all .5s ease-out;
-o-transition: all .5s ease-out;
-ms-transition: all .5s ease-out;
transition: all .5s ease-out;
}
#nav a:hover {
letter-spacing: 5px;
color: #74194e;
padding: 7px 2px;
}
.hex {
position: relative;
top: 600px;
left: 100px;
background-color: transparent;
text-align: center;
}
.owl {
position: relative;
top: 800px;
left: 100px;
background-color: transparent;
text-align: center;
}
.club {
position: relative;
top: 1000px;
left: 100px;
background-color: transparent;
text-align: center;
}
b { color: #ab4860; }
u { color: #ab4860; }
i { color: #ab4860; }
<div id="nav">
<div class="hex">Back to HEX</div><br>
<div class="owl">Owl Me</div><br>
<div class="club">Club Rainbow Brigade</div><br>
</div>
<div align="left">
<div style="overflow:auto;position:relative;width:700px;height:720px;top:-350px;left:390px;margin-right:-546px;margin-bottom:-300px;">
Text here. <b>Bold.</b> <u>Underlined.</u> <i>Italic.</i></div>
</body>
Is there something I need to add, or remove in my code? Did I mess up somewhere and I can't see it?

I edit your code and get a working solution:
html, body {
margin:0;
padding:0;
}
body {
background-image:url(http://i.imgur.com/X3qmTN2.png);
background-repeat: no-repeat;
color:#e80812;
font-family:arial, sans-serif;
height:1660px;
text-align: justify;
width:1300px;
}
#nav {
line-height:80px;
position:absolute;
top:640px;
width:400px;
}
#nav a:link,
#nav a:visited,
#nav a:active {
color: #ab4860;
display: block;
font-family:arial;
font-size:14px;
letter-spacing:2px;
padding:7px;
text-align:center;
text-decoration:none;
text-transform:uppercase;
-webkit-transition:all .5s ease-out;
-moz-transition:all .5s ease-out;
-o-transition:all .5s ease-out;
-ms-transition:all .5s ease-out;
transition:all .5s ease-out;
}
#nav a:hover {
color:#74194e;
letter-spacing:5px;
padding:7px 2px;
}
.hex {
position:relative;
text-align:center;
}
.owl {
position:relative;
text-align:center;
top:15px;
}
.club {
position: relative;
text-align: center;
top:30px;
}
.content {
height:850px;
left:390px;
overflow:auto;
position:absolute;
top:640px;
width:910px;
}
b, u, i {
color: #ab4860;
}
<div id="nav">
<div class="hex">Back to HEX</div>
<div class="owl">Owl Me</div>
<div class="club">Club Rainbow Brigade</div>
</div>
<div align="left">
<div class="content">Text here. <b>Bold.</b> <u>Underlined.</u> <i>Italic.</i></div>
</div>
There was some typos in your HTML and CSS code. I solved this and do some changes to place all the elements to the right place.
A working fiddle you can find here: http://jsfiddle.net/hhf2kpLd/

The BR tags were your downfall, I've changed a few other things too.
<div id="nav">
<div class="hex">Back to HEX</div>
<div class="owl">Owl Me</div>
<div class="club">Club Rainbow Brigade</div>
</div>
http://jsfiddle.net/link2twenty/xxvkzz28/

The div
<div style="overflow:auto;position:relative;width:700px;height:720px;top:-350px;left:390px;margin-right:-546px;margin-bottom:-300px;">
Text here. <b>Bold.</b> <u>Underlined.</u> <i>Italic.</i></div>
Makes your content to be out of the delimited area of your html content. Use your Browser Inspector to see it. I think that some browsers will interpret your code in a different way and the result will be different (with some blank space for example).
Can you first upload your img on another site (like casimage.com) cause it's lock on my side (proxy limitation) ? And then you should structure your site on a different way, with no relative or absolute position.

I made some changes to your code, by this mode the menu's texts are positioned in his place. Top and left are 0 pixels. See the snippet in fullpage:
body {
background-image: url(http://i.imgur.com/X3qmTN2.png);
background-repeat: no-repeat;
background-attachment: scroll;
height: 100px;
padding-bottom: 0;
font-family: Arial, sans-serif;
color: #e80812;
/* text-alignment doesnt exists, it's text align*/
text-align: justify;
}
#nav {
width: 400px;
line-height: 80px;
padding-top: 670px;
}
#nav a:link, #nav a:visited, #nav a:active {
display: block;
font: 14px "arial";
text-transform: uppercase;
text-decoration: none;
text-align: center;
letter-spacing: 2px;
color: #ab4860;
padding: 7px;
-webkit-transition: all .5s ease-out;
-moz-transition: all .5s ease-out;
-o-transition: all .5s ease-out;
-ms-transition: all .5s ease-out;
transition: all .5s ease-out;
}
#nav a:hover {
letter-spacing: 5px;
color: #74194e;
padding: 7px 2px;
}
.hex {
position: relative;
top: 0;
left: 0;
background-color: transparent;
text-align: center;
}
.owl {
position: relative;
top: 0;
left: 0;
background-color: transparent;
text-align: center;
}
.club {
position: relative;
top: 0;
left: 0;
background-color: transparent;
text-align: center;
}
b { color: #ab4860; }
u { color: #ab4860; }
i { color: #ab4860; }
<div id="nav">
<div class="hex">Back to HEX</div><br>
<div class="owl">Owl Me</div><br>
<div class="club">Club Rainbow Brigade</div><br>
</div>
<div align="left">
<div style="overflow:auto;position:relative;width:700px;height:720px;top:-350px;left:390px;margin-right:-546px;margin-bottom:-300px;">
Text here. <b>Bold.</b> <u>Underlined.</u> <i>Italic.</i></div>

Related

How to increase the size available for an image so it does not get cut off?

I have tried altering the padding, using object-fit, and toyed around with different image sizes/settings. The image is obviously on there fine, but only way I can fit it is by making it super tiny which will not work for this.
<footer class="footer" id="footer-fixed">
<div class="footer-main">
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="widget widget-text">
<div class="logo logo-footer"> <img class="logo logo-display" src="assets/images/logo-footer.png" height=auto width=300 alt=""> </div>
<p>We’re nuts about making your wedding great.</p>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="widget widget-text widget-links">
<h5 class="widget-title">Contact Us</h5>
<ul>
<li><i class="mdi mdi-cellphone"></i>(712) 253-3765</li>
<li> <i class="mdi mdi-email"></i>micdropentertainment515#gmail.com</li>
</ul>
</div>
</div>
</div>
</div>
</div>
Here's the relevant css for it. Didn't want to make a big text dump but it feels like I didn't have enough info in my original post. Most of this is unrelated to the image but I'm so new to coding that some this may be relevant in different ways.
//--Footer CSS--//
/*=============================================
Footer
=============================================*/
#media only screen and (min-width: 992px) {
#footer-fixed {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
}
.footer{
font-size:16px;
}
.footer-main{
padding:80px 0 60px;
background-color: #212121;
position: relative;
}
.footer .widget-title{
position: relative;
font-size: 14px;
line-height: 1.4;
text-transform: uppercase;
margin-bottom: 30px;
color: #fff;
letter-spacing: 1px;
font-weight: 700;
font-family: 'Source Sans Pro', sans-serif;
}
.footer .widget-text p {color:#fff;}
.footer .widget-title:before{
content:'';
position: absolute;
top:100%;
margin-top: 10px;
left: 0;
width: 40px;
border-top: 1px solid #333;
}
.footer .widget-links{
font-size: 16px;
font-family: 'Source Sans Pro', sans-serif;
}
.footer .widget-links li{
margin-bottom: 14px;
list-style:none;
}
.footer .widget-links li i {
color:#fff;
padding-right: 10px;
}
.footer .widget-links a{
color: #fff;
}
.footer .widget-links a:hover{
color:#2196F3;
text-decoration: none;
}
.footer-copyright{
padding: 30px 0;
background-color: #111312;
}
.copy-right{margin-top:5px;color:#fff;}
.footer-copyright ul.social-media{
float:left;
display:block;
margin-bottom:0;
margin-top: 5px;
}
.footer-copyright ul.social-media li {
display:inline-block;
margin-right: 17px;
}
.footer-copyright ul.social-media li:last-child {
margin-right:0;
}
.footer-copyright ul.social-media li a{
font-size: 20px;
display: inline-block;
color: #fff;
}
.footer-copyright ul.social-media li a:hover{
color: #2196F3;
}
.flat-footer ul.social-media{
float:none;
display:block;
margin-bottom:0;
margin-top: 5px;
}
.flat-footer ul.social-media li {
display:inline-block;
margin-right: 17px;
}
.flat-footer ul.social-media li:last-child {
margin-right:0;
}
.flat-footer ul.social-media li a{
font-size: 20px;
display: inline-block;
color: #fff;
}
.flat-footer ul.social-media li a:hover{
color: #2196F3;
}
ul.footer-gallery {margin:0;}
ul.footer-gallery li {
display: inline-block;
width: 24%;
padding: 0 2px 0px 0;
margin-bottom: 5px;
}
ul.footer-gallery li img {
max-width: 100%;
width: 100%;
}
.footer-gallery-box {
position: relative;
overflow: hidden;
}
.footer-gallery-box .skin-overlay {
background-color: rgba(30, 192, 255, 0.9);
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
-webkit-transition: opacity 0.2s ease-out;
-moz-transition: opacity 0.2s ease-out;
-o-transition: opacity 0.2s ease-out;
transition: opacity 0.2s ease-out;
}
.footer-gallery-box:hover .skin-overlay{
opacity: 1;
}
.footer-gallery-box .zoom-wrap {
position: absolute;
top: 0%;
left: 0;
width: 100%;
height: 100%;
}
.footer-gallery-zoom {
position: absolute;
left: 0;
top: 40%;
width: 100%;
}
.footer-gallery-zoom li {
position: relative;
bottom: -40px;
opacity: 0;
visibility: hidden;
transform: translateZ(0);
}
.footer-gallery-box:hover .footer-gallery-zoom li{
bottom: 0;
opacity: 1;
visibility: visible;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s;
}
.footer-gallery-zoom li a {
color:#fff;
}
.footer-gallery-zoom li a:hover, .footer-gallery-zoom li a:focus {
color:#212121;
}
.logo-footer {
height: 60px;
width: 300px;
}
.logo-footer img {
width: 100%;
}
.contact-widget.widget ul li {
padding-left: 25px;
position: relative;
}
.contact-widget.widget ul li i {
position: absolute;
left: 0;
top: 1px;
}
The cut off half fist that's giving me issues
If I understand your problem correctly, then the code you provided doesn't look like it cuts off any part of the image either.
Usually when an image is being cut off it's because the container it's in has this CSS being applied to it:
overflow: hidden;
Nevertheless, here's what I think you're looking for as a solution.
https://jsfiddle.net/nmfqc6dj/

Center Logo and nav bar horizontal

How can i center my logo (img) and menu links horizontal. I want the logo to be at the left and menu at right but horizontal centered.
here's my code!
thanks
<div class="menu-container">
<div class="logo">
<img src=https://app.box.com/representation/file_version_186133299510/image_2048/1.png class="logo">
</div>
<nav class="menu">
Branding
Logos
Illustration
Web
Poster
Letters
All
About
</nav>
</div>
<div class="main-intro">
<h2>Let's create something great together!</h2>
</div>
---CSS---
* {
padding: 0px;
margin: 0px;
}
.menu-container{
background-color: gray;
margin: 30px;
position
}
.logo {
height: 10em;
display: inline-block;
padding: 1em;
transition: all 0.6s ease;
-webkit-transition: all 0.6s ease;
}
.menu {
float: right;
margin: 2em; 2em; 0; 0;
display: inline-block;
vertical-align: center;
}
https://codepen.io/Randomood/pen/KmJpWX?editors=1100
try removing the height of your logo from you css?
.logo {
display: inline-block;
padding: 1em;
transition: all 0.6s ease;
-webkit-transition: all 0.6s ease;
}
EDITED:
* {
padding: 0px;
margin: 0px;
}
.menu-container{
background-color: gray;
margin: 30px;
position: relative;
padding: 1em;
}
.logo {
height:10em;
border: 1px solid red;
display: inline-block;
transition: all 0.6s ease;
-webkit-transition: all 0.6s ease;
}
.menu {
float: right;
margin: 4.5em 0em;
display: inline-block;
vertical-align: center;
}
Just try doing this to your "menu-container"
.menu-container{
display:flex;
flex-direction:row;
justify-content:center;
background-color: gray;
margin: 30px;
}
Codepen

hover not working for navigation menu

I'm not sure why hover isn't working for this page, the other work fine. Can anybody find a solution to this, because I tried but for some reason I can't get it to work?
My CSS code is below my HTML.
I think it the issue may lie here but I can't seem to figure it out.
Everything seems fine to me when I validated it.
Could it be I used too many hover for this CSS?
HTML
<body>
<input type="checkbox" id="menutoggle">
<label for="menutoggle" class="menu-icon">☰</label>
<header>
<div id="brand"><img src="http://www.grazinburger.com/images/menu_icon.png" alt="menu"></div>
</header>
<nav class="menu">
<ul>
<li id="video">Favorites</li>
<li id="portfolio">Portfolio</li>
<li id="blog">Blog</li>
</ul>
</nav>
</body>
CSS
body {
font-family: sans-serif;
}
a { color: red;
text-decoration: none;
}
li {
list-style: none;
}
ul {
padding: 0;
margin: 0;
}
header {
width: 100%;
height: 50px;
margin: auto;
color: red;
}
#brand {
float: left;
line-height: 50px;
color: #EEE;
font-size: 25px;
font-weight: bolder;
font-family: 'Anonymous Pro', ;
}
#brand img {
max-width: 12%;
}
nav { width:100%;
text-align:center;
}
nav a:hover {
background-color: black;
opacity: .4;
}
nav a {
display: block;
padding: 15px 0;
border-bottom: 1px solid gray;
color: antiquewhite;
font-family: 'Anonymous Pro', ;
font-weight: bold;
font-size: 1.25em;
}
nav li:last-child a {
border-bottom: none;
}
.menu li {
border-left: none;
}
#video {
background-image: url(http://clearancebinreview.com/wp-content/uploads/2011/01/1-30-11_news_video_game_backgrounds1.jpg);
}
#portfolio {
background-image: url(http://www.digitalgov.gov/files/2015/01/600-x-400-Composite-image-of-file-transfer-background-Wavebreakmedia-Ltd-Wavebreak-Media-Thinkstock-488641549.jpg);
background-position: center;
}
#blog {
background-image:url(../img/Anime-Panti-Ando-with-Gun-and-Sword-600x375.jpg);
background-position: top;
}
.menu {
width: 240px;
height: 210px;
position: absolute;
left: -240px;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
}
.menu-icon {
padding: 10px 20px;
color: aquamarine;
cursor:pointer;
float: right;
}
#menutoggle {
display: none;
}
#menutoggle:checked ~ .menu {
position:absolute; left: 0; }
Hover appears to work for me:
https://jsfiddle.net/bd2d6jac/
Assuming your referring to nav a:hover

Margins not correctly staying at 100% of the webpage broswer

So I'm working on an application for my Software Engineering class, and I've hit a wall with fixing the width of my webpage. Here is a link to a cloud version of the running application: Link to display issue As you can see when the box is rescaled the header changes sizes, and creates a large white box underneath, and also there is always a scroll bar at the bottom even when max size on my monitor.
html, body {
padding: 0px;
margin: 0px;
border: 0px;
height: 100%;
width: 100%;
font-size: 100%;
}
body {
display: block;
background-color: #f7f7f7;
}
body, header, footer, h1 {
font-family: 'Lato', sans-serif;
}
#wrapper {
width: 100%;
height: 100%;
margin: 50px auto;
}
.button {
width: 240px;
height: 45px;
-webkit-border-radius: 2px;
border-radius: 2px;
margin: 0 auto;
cursor: pointer;
}
.facebook {
margin-bottom: 25px;
background-color: #A0BBD6;
-webkit-transition: background-color .2s ease;
-moz-transition: background-color .2s ease;
-ms-transition: background-color .2s ease;
-o-transition: background-color .2s ease;
transition: background-color .2s ease;
}
.facebook:hover {
background-color: #88a5c2;
}
.submit {
margin-top: 20px;
background-color: #a6d7a0;
-webkit-transition: background-color .2s ease;
-moz-transition: background-color .2s ease;
-ms-transition: background-color .2s ease;
-o-transition: background-color .2s ease;
transition: background-color .2s ease;
}
.submit:hover {
background-color: #93c08e;
}
p {
text-align: center;
color: #FFFFFF;
padding: 0 300px;
font-weight: 300;
font-size: 0.8em;
}
.form {
border: thin solid #ededed;
position: relative;
margin: 30px auto;
width: 290px;
height: auto;
background-color: #ffffff;
padding: 30px 0;
-webkit-border-radius: 2px;
border-radius: 2px;
}
input[type=text] {
background: url(http://imageshack.com/a/img812/1096/y67f.png) no-repeat 15px 13px;
}
input[type=password] {
position: relative;
top: -5px;
background: url(http://imageshack.com/a/img812/6980/lcnq.png) no-repeat 15px 13px;
}
input[type=text], input[type=password] {
width: 195px;
height: 40px;
-webkit-border-radius: 2px;
border-radius: 2px;
margin: 0 auto;
display: block;
border: none;
background-color: #EBEBEB;
padding: 2px 0 2px 45px;
-webkit-background-size: 18px;
-o-background-size: 18px;
background-size: 18px;
font-size: 15px;
font-weight: 300;
color: #777;
-webkit-transition: background-color .2s ease;
-moz-transition: background-color .2s ease;
-ms-transition: background-color .2s ease;
-o-transition: background-color .2s ease;
transition: background-color .2s ease;
}
input[type=text]:focus, input[type=password]:focus {
outline: none;
background-color: #f3f3f3;
}
img {
width: 24px;
height: auto;
display: block;
margin: 0 auto;
padding: 11px 0;
}
#header {
padding-left: 50px;
position: relative;
width: 100%;
height: 50px;
font-size: 2.0em;
}
h1 {
font-size: 1.0em;
font-color: black;
}
#navigationBar {
width: 100%;
background-color: #980000;
height: 30px;
text-align: right;
}
#footer {
width: 100%;
height: 40px;
position: relative;
background-color: #980000;
min-width: 100%;
padding-bottom: 0;
}
div {
display: block;
}
a.navButton:link,a.navButton:visited {
color:#000000;
text-decoration:none;
}
a.navButton:hover,a.navButton:active {
color:#FFFFFF;
text-decoration:none;
}
This is because the padding is added to the width.
Use box-sizing: border-box on your header like
#header {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Here's a Fiddle.
Your header and footer is the problem.
First, take away the padding: 0 300px; from the footer > p then take away width: 100% on the header tag since it's really not needed.

Text isn't properly centered?

I have my social menu text-aligned:center but it's still is off quite a ways. Here's my code and a jsfiddle to demonstrate the trouble. As you can see it has more open space on the left than right. I want to even it out.
jsfiddle
HTML
<div id="wrapper">
<div id="header">
Erratic Fox
</div>
<div id="social">
<ul>
<li>Facebook</li> —
<li>Deviant Art</li> —
<li>YouTube</li> —
<li>Steam</li>
</ul>
</div>
</div>
CSS
body {
margin-top: 10px;
background-color: #E5E5E5;
}
#header {
color: #404040;
width: 50%;
margin: auto;
background-color: #ffffff;
font-size:100px;
text-align: center;
}
#social {
font-family: Roboto;
font-size: 18px;
line-height: 100px;
text-align: center;
height: 100px;
width: 50%;
background-color: white;
margin-left: auto;
margin-right: auto;
margin-top: 10px;
}
#social a {
text-decoration: none;
color: #404040;
transition: 1s color;
-moz-transition: 1s color;
-webkit-transition: 1s color;
}
#social a:hover {
color: #427FED;
transition: 1s color;
-moz-transition: 1s color;
-webkit-transition: 1s color;
}
#social li {
margin-right: 30px;
margin-left: 30px;
display: inline;
}
Add
#social ul {
padding-left:0;
}
Demo
Try to implement this:
ul { padding: 0; margin: 0; }