This is really really weird. Sometimes when I reload it shows where it should be, like this:
When I change the color to Orange or Blue (haven't tested any other colors, that ul is brought down. What's the reason? Thanks for the help!
#topuserbar a
{
color:Orange;
}
Here is the complete CSS and HTML.
body
{
background-image: url('images/test.png');
background-repeat:repeat;
margin:0;
padding:0;
}
#header
{
background-image: url('images/headerBackground.png');
background-repeat:repeat;
width:auto;
}
#headershadow
{
background-color:Black;
min-height:2px;
}
#topuserbar
{
font-family:Georgia;
font-size:large;
float:right;
margin-top:35px;
margin-right:15px;
}
#topuserbar ul
{
}
#topuserbar li
{
display:inline;
margin-left:10px;
color:#fff;
}
#topuserbar .helpicon
{
position:relative;
top:4px;
left:2px;
}
#topuserbar a
{
color:Blue;
}
#topuserbar a:hover
{
color:Yellow;
}
/*****************BODY AREA*******************/
#body
{
border: 1px solid red;
min-height:800px;
width:auto;
margin-left:50px;
margin-right:50px;
}
#leftnavigation
{
border: 1px solid green;
min-height:500px;
float:left;
width:190px;
}
#contentarea
{
border:1px solid blue;
min-height:500px;
float:left;
width:300;
margin-left:5px;
margin-right:5px;
}
#advertisingarea
{
border:1px solid orange;
width:150px;
float:left;
min-height:500px;
}
.advert
{
}
<%# Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<script src="../../Scripts/jquery-1.4.1.min.js"></script>
<script src="../../Scripts/jquery.tipTip.minified.js"></script>
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<link href="../../Content/tipTip.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<img src="../../Content/images/cumaviLogo.png" alt="Cumavi.com - Compras y ventas online en Bolivia!" />
<ul id="topuserbar">
<li>Bienvenidos, <span class="userSalute">Sergio!</span></li>
<li>Mis Anuncios</li>
<li>Perfil</li>
<li>Ayuda<img class="helpicon" src="../../Content/images/helpIcon.png" alt="Help icon." width="20" height="20"/></li>
<li>Cerrar Sesion</li>
</ul>
</div>
<div id="headershadow">
</div>
<div id="body">
<div id="leftnavigation"></div>
<div id="contentarea">sdfg<h1>asdasd</h1></div>
<div id="advertisingarea">
<div class="advert">
<img src="../../Content/images/advertImage.png" alt="Advert" />
</div>
<div class="advert">
<img src="../../Content/images/advertImage.png" alt="Advert" />
</div>
<div class="advert">
<img src="../../Content/images/advertImage.png" alt="Advert" />
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$(".someClass").tipTip();
});
</script>
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</body>
</html>
Well, your menu ( #topuserbar ) is floated and is container is not.
You can change lots of things in your css to set a proper floated layout...
- or -
Just change the way you set the position of the menu like :
#topuserbar
{
font-family:Georgia;
font-size:large;
margin-top:35px;
margin-right:15px;
text-align: right;
}
... for example.
Related
I don't use min-height command. I want to add data in section area. But I see the situation in this picture. When I am adding bigger things than section area, I see the situation in first picture.
Intented Situation:
<!DOCTYPE html>
<html>
<head>
<title>Sayfa Düzeni</title>
<meta charset="utf-8">
<link rel="stylesheet" href="./script/style.css">
<style>
body{
margin:0;
padding:0;
}
#wrapper{
margin:auto;
max-width:900px;
border-color:black;
border-style:solid;
min-height:500px;
background-color:yellow;
}
header{
max-width:900px;
height:70px;
border-color:gray;
border-style:dashed;
background-color:cyan;
}
nav{
max-width:900px;
height:50px;
border-color:gray;
border-style:dashed;
background-color:pink
}
aside{
float:left;
width:150px;
min-height:280px;
border-color:gray;
border-style:dashed;
background-color:cyan;
}
section{
float:left;
width:738px;
min-height:280px;
border-color:gray;
border-style:dashed;
background-color:white;
}
footer{
float:left;
min-width:894px;
min-height:76px;
border-color:gray;
border-style:dashed;
background-color:pink;
}
</style>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Dağcılık ve Kış Sporları Ürünleri</title>
<meta charset="utf-8">
<link rel="stylesheet" href="./script/style.css">
</head>
<body>
<div id="wrapper">
<header>Header</header>
<nav>
Anasayfa
Hizmetlerimiz
Ürünlerimiz
Biz Kimiz?
İletişim
</nav>
<aside>Yan Menü</aside>
<section>
Section
</section>
<footer>Sayfa Altı</footer>
</div>
</body>
</html>
<!-- begin snippet: js hide: false console: true babel: false -->
for section css;
width: 80.5%;
overflow-y: scroll;
for aside css;
width: 18%;
My layout currently breaks on 320px resolution (.info drops below .icon and breaks the layout) and I'm lost as to how about preventing it from breaking.
The .num info(number) is being loaded dynamically, and could be anything from 0 - 2147483647. If the screen resolution is not wide enough to show the .num and the .unread on one line, instead of breaking, I would like the .unread to drop down to the next line (display:block applied to it?). I tried to think of a way to use only css, then though I could use js to apply class if more than 2 digits are present, but this direction still doesn't seem right if the resolution is wider and could show more digits. E.G - 1000px could show many more digits... I would want it to stay on one line in this case.
My code is below:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css" />
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
<style>
body{
padding:20px;
}
.wrapper {
background-color:#cccccc;
border-radius:20px;
overflow:hidden;
border:2px solid black;
}
.icon {
font-size:40px;
padding:12px;
display:block;
}
.icon, .info {
float:left;
}
.info {
border-left:1px solid black;
padding-left: 15px;
}
.info h3 {
font-size:16px;
margin:10px 0 0;
}
.info p {
margin:10px 0;
}
.num {
font-weight:bold;
font-size:20px;
}
.unread {
white-space: nowrap;
}
</style>
</head>
<body>
<div class="wrapper">
<div>
<div class="icon">X</div>
<div class="info">
<h3>Header Information</h3>
<p>
<a class="num">23</a>
<span class="unread">Unchecked Voicemails to Date</span>
</p>
</div>
</div>
</div>
</body>
</html>
http://plnkr.co/edit/18Mids4M3SupNwOT8ocP?p=preview
I figured it out. I needed to add a width to the .info container and make the elements inside of .info p display:inline-block.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css" />
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
<style>
body{
padding:20px;
}
.wrapper {
background-color:#cccccc;
border-radius:20px;
overflow:hidden;
border:2px solid black;
}
.icon {
font-size:40px;
padding:12px;
}
.icon, .info {
float:left;
}
.info {
border-left:1px solid black;
padding-left:15px;
width:60%;
}
.info h3 {
font-size:16px;
margin:10px 0 0;
}
.info p {
margin:5px 0 15px;
}
.info span {
display:inline-block;
}
.num {
font-weight:bold;
font-size:20px;
}
</style>
</head>
<body>
<div class="wrapper">
<div>
<div class="icon">X</div>
<div class="info">
<h3>Header Information</h3>
<p>
<a class="num">2</a>
<span class="unread">Unopened Voicemails</span>
</p>
</div>
</div>
</div>
</body>
</html>
http://plnkr.co/edit/NanIRaMcK9AJvpNEQG3Z?p=preview
I am learning CSS by my onw, and already spent some hours on this, without solution...
I need to put a text over a image, but there is two images in the same line (inline-block). Please, see my code (example):
<html>
<head>
<title>Test</title>
<style type="text/css">
.payrow { display:inline-block; width:100%; margin-bottom:14px; text-align:center; }
.paybtn { display:inline-block; margin:0 10px 0 10px; text-align:center; }
.paybtn img { width:250px; height:120px; margin:3px; border:0; filter:alpha(opacity=80); opacity:.80; }
.paybtn a:hover img { filter:alpha(opacity=100); opacity:1; }
.vtotal { font:bold 20px Arial, Helvetica, sans-serif; color:#7A7A7A; }
</style>
</head>
<body>
<div class="payrow">
<div class="paybtn">
<img src="paybtn1.gif" alt="PayPal1">
<div class="vtotal">Total: U$ 510.00</div>
</div>
<div class="paybtn">
<img src="paybtn2.gif" alt="PayPal2">
<div class="vtotal">Total: U$ 580.00</div>
</div>
</div>
</body>
</html>
This is the result of my code:
And this is what I really want:
Please, can someone give me an idea of what to do?
Thanks!
You could use negative margins
.vtotal {
font:bold 20px Arial, Helvetica, sans-serif;
color:#7A7A7A;
position:relative;
margin-top:-40px; /*adjust the pixels accordingly*/
}
Demo at http://jsfiddle.net/gaby/5fxRf/
I have a nav bar. When the user makes their screen bigger I want my font size to auto adjust. I tried it with: li { font-size: 1.2vw; } It works if the page is refreshed after adjusting the screen. What would be the code for an auto update? I want my text to constantly change its size based on the window width.
<!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>Power</title>
<style type="text/css">
#page {
position:inherit;
display:block;
width:60%;
margin:auto;
min-width:1000px;
z-index:0;
}
#pageImg {
position:absolute;
width:60%;
min-width:1000px;
z-index:1;
}
#media (min-width: 1000px) {
#navBarImg {
top: 5vw;
}
#navBarLogoImg {
top: 5vw;
}
#navMenuPart1 {
top: 5vw;
left:60%;
}
}
#navBarImg {
position:absolute;
width:60%;
min-width:1000px;
top:50px;
z-index:2;
}
#navBarLogoImg {
position:absolute;
width:11.75%;
min-width:190px;
top:50px;
z-index:3;
}
#navMenuPart1{
position:absolute;
width:100%;
min-width:1000px;
left:20px;
top:50px;
z-index:3;
color: #FFFFFF;
}
li { font-size: 1.2vw; }
ul{ white-space: nowrap; }
.navMenuItems ul { list-style:none; text-align:center; padding:10px 0; }
.navMenuItems ul li { display:inline; padding:15px; letter-spacing:2px; }
.navMenuItems ul li a { text-decoration:none; color:#3a3a3a; }
.navMenuItems ul li a:hover {color:#F19433;}
</style>
</head>
<body>
<div id="page">
<img id="pageImg" src="../Navigation/backgroundImg.png" />
<div id="navBar">
<img id="navBarImg" src="../Navigation/navBarBGImg.png" />
<img id="navBarLogoImg" src="../Navigation/navLogoImg.png" />
</div>
<div id='navMenuPart1' class="navMenuItems">
<ul>
<li><a href='#'><span>Research</span></a></li>
<li><a href='#'><span>Team</span></a></li>
<li><a href='#'><span>News</span></a></li>
<li><a href='#'><span>Courses</span></a></li>
<li><a href='#'><span>Outreach</span></a></li>
<li><a href='#'><span>Contact</span></a></li>
</ul>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
causeRepaintsOn = $("li");
$(window).resize(function() {
causeRepaintsOn.css("z-index", 1);
});
</script>
<header></header>
</div>
</body>
</html>
EDIT:
Here is a FIDDLE - you can resize the page and see that it is working.
See this css-tricks article:
This is a webkit bug (Chrome,Safari) and it doesn't occur on IE10+ and FF 19+
In that article the author gives a Jquery solution for webkit browsers:
To fix this issue (allow resizing without page refresh) you need to
cause a "repaint" on the element. I used jQuery and just fiddled with
each elements (irrelevant, in this case) z-index value, which triggers
the repaint.
causeRepaintsOn = $("h1, h2, h3, p");
$(window).resize(function() {
causeRepaintsOn.css("z-index", 1);
});
So your page will look something like this:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Demo</title>
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
causeRepaintsOn = $("li");
$(window).resize(function() {
causeRepaintsOn.css("z-index", 1);
});
</script>
<header></header>
... etc etc..
</body>
</html>
Use,
font-size:1em;
or
font-size:100%; // based on body default declaration
If you have a css like this:
#body #mytext {
font-size: 50%;
}
you can dynamically resize in jQuery like this:
$(window).resize(function(){
$('#body #mytext').css('font-size',($(window).width()*0.5)+'px');
});
I'm having problems to align correctly the buttons on side by side. I need to build a solution without use the float resource. See it:
<!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>Documento sem título</title>
<style type="text/css">
* {
margin:0px;
padding:0px;
}
a {
display:inline-block;
padding: .63em;
border:1px solid #ccc;
position:relative;
}
.b2 {
padding: .0em 1em .0em 2.1em;
text-decoration:none
}
.icon {
position:absolute;
width:16px;
height:16px;
background-color:#999;
top:50%;
margin-top:-8px;
left:2px;
}
</style>
</head>
<body>
<div style="background-color:#f0f0f0; margin-top:50px; position:relative; height:22px; padding:4px;"> <span class="icon"></span>
<div style="display:inline-block; width:2px; height:22px; background-color:#666;"></div> <span class="icon"></span>
<span class="icon"></span><span>Casa d wqe dde qeasd sd</span>
</div>
<h2 style="background:#999"> test</h2>
<span class="icon"></span><span>Casa d wqe dde qeasd sd</span>
</body>
</html>
Try this here:
div .b2 {
top:-6px;
}
Demo
What about using an unordered list item? See this jsFiddle: jsFiddle
You set it to be inline using the CSS properties like this:
li {
list-style:none;
display:inline;
}