473,569 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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%;marg in:0;color:$tex t-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:$he ader-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:hidd en;}

#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"><b r class="clear" />
<h3 id="brandmark"> <a href="index.htm l" title="company name
text">company name text</a></h3>
<strong id="slogan">tag line</strong>
</div>

</div>

</body>
</html>

Nov 5 '06 #1
4 8668
"Dave" <da****@gmail.c omwrote in
comp.infosystem s.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 <!DOCTYPEdeclar ation
line 2 column 1 - Warning: inserting missing 'title' element
line 3 column 2 - Warning: <styleinserti ng "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%;marg in:0;color:$tex t-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:$he ader-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:hidd en;}

#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"><b r class="clear" />

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

<h3 id="brandmark"> <a href="index.htm l" title="company name
text">company name text</a></h3>
<strong id="slogan">tag line</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:le ft;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:ri ght;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@g mailDOTHEREcomw rote:
[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:le ft;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
33517
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 capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it...
14
26463
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
2645
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"> <HTML><Head><Title>Get my feet off the ground</Title> <Meta HTTP-Equiv="Content-Type" Content="text/html; charset=us-ascii"> <Style type="text/css"> Body { font-size:...
3
5476
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; padding: 2% } ..sideleft { float: left; background-color: #fff;
7
2620
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, each one has a comment line under the picture. And I wish when the screen size is big, this thumbnails arrange 3 rows, 4 columns; if the browser...
14
5566
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 things). I note the document specifies that block level content can be included within a <map>. Testing this in order to discover why one might...
3
2266
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
3814
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 For...Next and If...End If blocks can have their own variables. So,
7
3417
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. I read and re-read carefully the CSS 2.1 spec and I just can not see why. Related webpages: ...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.