473,416 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

CSS div block clear...I don't even know..??

TIA for the help.....this should be easy for a pro....I need the two
divs with text to display on the same line at the top of the
container..???
<html>
<head>
<style>
body {background-color: $background-color; background-image:url('') ;
font:normal $global-font-size $text-font; text-align:center;
width:100%;margin:0;color:$text-color; }

..clear {clear:both; display:block; font-size:1px; height:1px;
line-height:-1;}

#maintype #caption {background-color:#fff; padding:15px;}

#container {margin:0 auto; text-align:left; width:760px; border-bottom:
1px solid #000000;border-left: 1px solid #000000;
border-right: 1px solid #000000; $page-border-color; background-color:
#ffffff;}

#header {background:$header-background-color
url('$header-background-image') ; zoom:1; min-height:75px;} /* _height
and zoom are MS hacks */
#header:after {clear:both; content:"."; display:block; height:0;
visibility:hidden;}

#brandmark {float:left; font:normal $company-name-text-size
$company-name-text-font; width:500px;} /* 510 + 250 = 760 */

#brandmark a {color:$company-name-text-link-color; display:block;
padding:0 0 5px 13px; text-decoration:none;}

#slogan {color:$tagline-content-text-color; display:block; float:right;
font:normal $tagline-content-text-size $tagline-content-text-font;
padding:2.7em 15px 10px 10px; width:225px; text-align:right;} /* 225 +
25= 250 */

</style>
</head>
<body class="vertical" id="maintype">
<div id="container">
<div id="header"><br class="clear" />
<h3 id="brandmark"><a href="index.html" title="company name
text">company name text</a></h3>
<strong id="slogan">tagline</strong>
</div>

</div>

</body>
</html>

Nov 5 '06 #1
4 8643
"Dave" <da****@gmail.comwrote in
comp.infosystems.www.authoring.stylesheets:
TIA for the help.....this should be easy for a pro....I need the two
divs with text to display on the same line at the top of the
container..???
First, it's good to validate both HTML and CSS. My embedded validator
came up with 3 warnings in HTML, which I list here:

line 1 column 1 - Warning: missing <!DOCTYPEdeclaration
line 2 column 1 - Warning: inserting missing 'title' element
line 3 column 2 - Warning: <styleinserting "type" attribute

0 errors / 3 warnings

Theese are listed as warnings, but in my opinion they are all serious
omissions of required HTML structural parts, required by the
recommendation and thus errors.
As for your CSS, my embedded CSS validator came up with:

Warning: Expected color but found '$'. Error in parsing value for
property 'background-color'. Declaration dropped.
Line: 4
----------
Warning: Error in parsing value for property 'font'. Declaration dropped.
Line: 5
----------
Warning: Expected color but found '$'. Error in parsing value for
property 'color'. Declaration dropped.
Line: 6
----------
Warning: Error in parsing value for property 'line-height'. Declaration
dropped.
Line: 9
----------
Warning: Expected declaration but found '$'. Skipped to next declaration.
Line: 15
----------
Warning: Error in parsing value for property 'background'. Declaration
dropped.
Line: 18
----------
Warning: Unknown property 'zoom'. Declaration dropped.
Line: 19
----------
Warning: Error in parsing value for property 'font'. Declaration dropped.
Line: 24
----------
Warning: Expected color but found '$'. Error in parsing value for
property 'color'. Declaration dropped.
Line: 27
----------
Warning: Expected color but found '$'. Error in parsing value for
property 'color'. Declaration dropped.
Line: 30
----------
Warning: Error in parsing value for property 'font'. Declaration dropped.
Line: 31
You actually look like you are using a server-side pre-ASP/PHP variable
substitution technique I used to construct more than a decade ago.
Problem is that these '$' variables are not legal CSS.
>
<html>
<head>
<style>
body {background-color: $background-color; background-image:url('') ;
font:normal $global-font-size $text-font; text-align:center;
width:100%;margin:0;color:$text-color; }

.clear {clear:both; display:block; font-size:1px; height:1px;
line-height:-1;}

#maintype #caption {background-color:#fff; padding:15px;}

#container {margin:0 auto; text-align:left; width:760px; border-bottom:
1px solid #000000;border-left: 1px solid #000000;
border-right: 1px solid #000000; $page-border-color; background-color:
#ffffff;}

#header {background:$header-background-color
url('$header-background-image') ; zoom:1; min-height:75px;} /* _height
and zoom are MS hacks */
#header:after {clear:both; content:"."; display:block; height:0;
visibility:hidden;}

#brandmark {float:left; font:normal $company-name-text-size
$company-name-text-font; width:500px;} /* 510 + 250 = 760 */

#brandmark a {color:$company-name-text-link-color; display:block;
padding:0 0 5px 13px; text-decoration:none;}

#slogan {color:$tagline-content-text-color; display:block; float:right;
font:normal $tagline-content-text-size $tagline-content-text-font;
padding:2.7em 15px 10px 10px; width:225px; text-align:right;} /* 225 +
25= 250 */

</style>
</head>
<body class="vertical" id="maintype">
<div id="container">
<div id="header"><br class="clear" />

An etago <element/is legal and required XHTML, but not HTML.

<h3 id="brandmark"><a href="index.html" title="company name
text">company name text</a></h3>
<strong id="slogan">tagline</strong>
</div>

</div>

As to your question, it's not even described by your HTML. You have two
DIV elements, one nested in another. Your question however is described
schematically as follows:
+-----------------------------+--------------------------+
| DIV 1 with some text | DIV 2 with some text |
+-----------------------------+--------------------------+
| the "container" upon which these two DIVs sit |
+--------------------------------------------------------+

This is how I interpret your question.

If this is what you want, there is at least one way I would approach this:

Float DIV2 to the right, or float DIV1 to the left. The floated DIV must
always be parsed first in the web document.

Thus:

<div style="float:left;width:50%;">
DIV 1 with some text
</div>
<div>
DIV 2 with some text
</div>
<div id="some-container-that-sits-below-it-all">
the "container" upon which these two DIVs sit
</div>

OR

<div style="float:right;width:50%;">
DIV 2 with some text
</div>
<div>
DIV 1 with some text
</div>
<div id="some-container-that-sits-below-it-all">
the "container" upon which these two DIVs sit
</div>

I have used the style attribute approach rather than style element but
only to be illustrative, but you should prefer the latter as you seem to
have. The width property is crucial as to how the floated div will share
the same space in being vertically positioned with the other div. I use
either the percentage of the parent container (this case, body) width but
sometimes a character width ('em' value).

Another approach would be to do absolute positioning, but there are people
more knowledgeable about the use of this (and its caveats), and maybe they
will say something here that both you and I can follow.
>
</body>
</html>



Nov 5 '06 #2
On 2006-11-05, Patient Guy <sevisen.adam@gmailDOTHEREcomwrote:
[snip]
As to your question, it's not even described by your HTML.
I can't understand the OP's question either.
You have two DIV elements, one nested in another. Your question
however is described schematically as follows:
+-----------------------------+--------------------------+
| DIV 1 with some text | DIV 2 with some text |
+-----------------------------+--------------------------+
| the "container" upon which these two DIVs sit |
+--------------------------------------------------------+

This is how I interpret your question.

If this is what you want, there is at least one way I would approach this:

Float DIV2 to the right, or float DIV1 to the left. The floated DIV must
always be parsed first in the web document.

Thus:

<div style="float:left;width:50%;">
DIV 1 with some text
</div>
<div>
DIV 2 with some text
</div>
<div id="some-container-that-sits-below-it-all">
the "container" upon which these two DIVs sit
</div>
You also need to set "clear: both" on that last div I think.
Nov 5 '06 #3
Dave wrote:
TIA for the help.....I need the two
divs with text to display on the same line at the top of the
container..???
No wonder you are having problems with such convoluted coding.
In any case, to have the two line up with your, uhm stuff, adjust the
padding on the one floating right. That will do it.

--
Gus
Nov 5 '06 #4

Gus ,

Thanks you that's what I did and some other tweaks....

Nov 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
14
by: pcchong | last post by:
I use a free database-driven ASP guestbook. I want to add a IP address blocking filter to it( just to block one particular guest). What is the easiest way to do so? Thanks. pcchong
4
by: Christopher | last post by:
This should be a quick one. URL: http://cfa-www.harvard.edu/~cpilman/Stuff/flush.html Code: ============================= <!DOCTYPE HTML Public "-//W3C//DTD HTML 4.01//EN">...
3
by: David Ross | last post by:
I sometimes place a sidebar on a Web page, using the following: ..sideright { float: right; background-color: #fff; width: 40%; font-size: 90%; text-align: justify; margin-left: 1em;...
7
by: Zhang Weiwu | last post by:
Hello. This is problem puzzled me a long time. I wish to organize some block elements and let them flow one after each other like text. Think about a album, I wish the album have 12 thumbnails,...
14
by: laurence | last post by:
I am implementing a comprehensive image-map generator utility, so have been studying W3C HTML 4.01 Specification (http://www.w3.org/TR/html4/struct/objects.html#h-13.6) on image maps (among other...
3
by: Ori | last post by:
Hi, I have a wired problem. I have a code block in my code (ASPX file) which I need to force it to be transactional. I'm doing the following: 1. for each one of the items
10
by: ElanKathir .S.N | last post by:
Hi all ! VB.NET adds the ability to create variables that are visible only within a block. A block is any section of code that ends with one of the words End , Loop , or Next . This means that...
7
by: GTalbot | last post by:
Hello fellow authoring.stylesheets colleagues, Can someone please explain why the bottom margin of the last inflow block-level child in an overflowed parent should not have its margin reachable....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.