473,382 Members | 1,583 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,382 software developers and data experts.

Formatting help needed

I am new to CSS and am trying new things and am stuck at 4 am. The site
in question is

http://www.robert4.com/test/fitting.html

It is just a test page for me to practice with for a bit. My goal is to
have a pad on the page with a different background color to offset the
middle content. I also want to butt the logo and the header together but
there is a gap between them. If I use absolute positioning my problem is
what happens in the dark blue content area in that it won't span the
width of the screen. It stops when the text does. I have been trying
now for a while to get the logo and header next to each other and can do
it with absolute positioning, but how can I get the header part to fill
across to the page padding? Also, I used absolute positioning on the
dark blue section figuring 10px for the page pad and 114px for the image
height so I thought 124px from the top would place it right at the bottom
of the logo and header. Apparently I am wrong about that also.

I realize this is alot at once, but would appreciate some pointers or
references on layout techniques such as this. The book I am reading
doesn't go into this much detail.

I did notice that if I didn't use the float tag for the logo I could use
"margin-left: 80" in the header tag and the header would be perfectly
aligned with the edge of the logo BUT on the row underneath instead of
next to it.

Any help would be greatly appreciated
robert
Jul 20 '05 #1
2 1654
"robert4" <bo***@hotmail.com> wrote in
comp.infosystems.www.authoring.stylesheets:
I realize this is alot at once, but would appreciate some pointers or
references on layout techniques such as this. The book I am reading
doesn't go into this much detail.


Meaning no disrespect, I think you're trying to do too much at once.
The (unnamed) "book" you are reading may not be a good one, or it
may not be right for you at this time.

Seems to me you're trying to run before you've even begun walking.
For instance, your surprise at "margin" and "float" leading to
different vertical alignment says you really need to spend some work
on understanding the basic concepts. Try a book by Eric Meyer, or
one of the many good CSS tutorials on the Web. By all means look at
the spec for particular things, particularly the box model.

Please don't feel I'm trying to insult you. I'm not trying to say
"Go away and don't bother us." I'm just saying that you're asking a
lot of detail questions about fairly advanced concepts and it's
going to be less frustrating for you if you get the basics down
first -- which we can also help with.

Putting up a sample page was absolutely the right thing to do. Now
try some more reading (probably with a better book) and
experimenting with one thing at a time. Even if you may be naturally
impatient to accomplish a lot, you'll probably get better quality
responses if you don't mix up too many questions in one big lump.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #2
robert4 wrote:
I am new to CSS and am trying new things and am stuck at 4 am. The site
in question is

http://www.robert4.com/test/fitting.html

(1) I want to butt the logo and the header together but there is a gap.
(2) the dark blue content area won't span the width of the screen.
(3) place [dak blue area] right at the bottom of the logo and header.

Any help would be greatly appreciated
robert


I will provide a solution and explanation for 2/3 problems (last two).
Perhaps someone will jump in and do so for the IE spacing problem; Logo
to Header.
Replace your stylesheet with this and read the notes therein:

body {margin:0; padding:0;} /* See Notes below */
#page {
background-color: #FFF8DC;
padding: 10px 10px 0 10px;
}
#header {
font-family: "Comic Sans MS";
font-size: 36px;
background-color: #AFEEEE;
text-align: center;
height: 114px;
/* margin-left: 80px;
This is not needed. Since #logo is floated to the left,
#header will automatically go to the right of it,
as long as it will fit, which it does.
*/
}
#logo {
background-color: Teal;
width: 80px;
height: 114px;
float: left;
}
#new {
background-color: Blue;
font-size: 24px;
color: White;
/* position: absolute;
top: 124px;
This top value does not take into account the browsers' default
margin values for body. It is a good idea to include:
body {margin:0;padding:0;}
as included above. These two properties will now work as far as the
value is concerned.
For the Blue section to fit the full width:
Without a position property, the div will be Static Block which
will fit the full width. It does not take positioning properties.
(If width &/or height properties are needed, use Relative Block Model.)
*/
}

--
Gus
Jul 20 '05 #3

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

Similar topics

5
by: Thomas Philips | last post by:
Consider the following simple dictionary e={1:'one', 2: 'two'} e >>>'one' However, If I attempt to print e using a formatted string print " %(1)s" %e, I get a KeyError: '1'
20
by: Pierre Fortin | last post by:
Hi! "Python Essential Reference" - 2nd Ed, on P. 47 states that a string format can include "*" for a field width (no restrictions noted); yet... >>> "%*d" % (6,2) # works as expected ' ...
163
by: Shiperton Henethe | last post by:
Hi Know any good utilities to help me strip out the tags that Microsoft Excel 2002 leaved behind when you try and export an HTML format file? This is driving me NUTS. And really makes me...
22
by: KsAdmin | last post by:
I have a question which has had me stumped for a few days now. I have a form that I add the values of fields together and display the total in a total field. I have the calculations working...
2
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
2
by: J055 | last post by:
Hi I've been looking into different ways of formatting columns/rows in the GridView control. I realize now, I think, that once the datasource is bound to the control the original column type...
11
by: Dustan | last post by:
Is there any builtin function or module with a function similar to my made-up, not-written deformat function as follows? I can't imagine it would be too easy to write, but possible... 'I am...
2
by: =?Utf-8?B?VG9jbw==?= | last post by:
Hello. My goal is to pain the entire row fore color as Red. If the value of column 24 is true (boolean), I wish to paint the row as Red. Otherwise, leave row as default (no formatting). The...
2
by: tomh2099 | last post by:
Hi, Hi, I have an ASP.NET 2005 application (using VB) with a GridView control that needs to have the last 5 or 6 rows in Bold or maybe some other special formatting. Most of the rows show...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.