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

Centered div box

Hello,

First of all, I'm just starting to use CSS so I am by no means
experienced in this matter.
What I want is a "box" div element that always is centered on the page.
Now I just use the center tag around my boxes, but I'm pretty sure there
must be a way to include the center positioning into the style code.
Anyone?
Also I had some people complaining about the colours of my site. I'm
using red (#6B0000) links on a black background, and on my monitor it
absolutely looks fine, but some people seem te have difficulties reading
the text. Opinions please? Site is located at http://deimos.curious.be/~dusk

Kind regards
Tommy
Oct 16 '05 #1
7 8797
TomB <dr******@dusk-metal.kicks-ass.org> wrote:
First of all, I'm just starting to use CSS so I am by no means
experienced in this matter.
Wrong group, stylesheet questions belong in
comp.infosystems.www.authoring.stylesheets
follow up set
What I want is a "box" div element that always is centered on the page.


http://dorward.me.uk/www/centre/

--
Spartanicus
Oct 16 '05 #2
TomB wrote:
What I want is a "box" div element that always is centered on the page.


<div style="width:60%;margin:0 20%">
....
</div>

comp.infosystems.www.authoring.stylesheets would have been a better place
for your query.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Oct 16 '05 #3
TomB wrote:

Hello,

First of all, I'm just starting to use CSS so I am by no means
experienced in this matter.
What I want is a "box" div element that always is centered on the page.
Now I just use the center tag around my boxes, but I'm pretty sure there
must be a way to include the center positioning into the style code.
Anyone?
Also I had some people complaining about the colours of my site. I'm
using red (#6B0000) links on a black background, and on my monitor it
absolutely looks fine, but some people seem te have difficulties reading
the text. Opinions please? Site is located at http://deimos.curious.be/~dusk


..box { display: block; /* box with visible border, background
white */
margin-top: 1em;
margin-left: auto; margin-right: auto; /* to center it */
width: 80%;
background-color: #fff;
border-color: #000;
border-style: solid;
border-width: thin;
padding: 2%;
text-align: justify }

I would not have bothered since (as others point out), this is
really a question for comp.infosystems.www.authoring.stylesheets.
However, you also asked a colors question.

You are specifying a dark red, not a true red (which would be
#ff0000). Dark red text against a black background is indeed
difficult to see.

Go to
<URL:http://sleepyoaks.com/HTML/hex_decimal_color_picker.htm>. Set
the Background to 000000 (black), Link to 6B0000 (your dark red),
and Active Link to ff0000 (true red). Compare the Link with the
Active Link.

In any case, if you define a color for Link, then you also need
contrasting colors for Visited Link and Active Link. When
selecting colors, don't forget that a sizable population is
color-blind. Don't put red text against a green background (or
vice versa), red-green being the most common form of
color-blindness (in which both appear gray). Also, a lack of
contrast between the text and the background might cause problems
for someone who is dyslexic.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Oct 16 '05 #4
On Sun, 16 Oct 2005 11:56:02 +0200, TomB wrote:
Also I had some people complaining about the colours of my site. I'm
using red (#6B0000) links on a black background, and on my monitor it
absolutely looks fine


You are joking right?

There is no way I can read that unless I wind up the size so that there are
only seven words on the first line of text.

What's with all you Heavy metal nuts (no pun intended) black and red do not
go together!
Oct 16 '05 #5
Rincewind wrote:
On Sun, 16 Oct 2005 11:56:02 +0200, TomB wrote:

Also I had some people complaining about the colours of my site. I'm
using red (#6B0000) links on a black background, and on my monitor it
absolutely looks fine

You are joking right?


No.
There is no way I can read that unless I wind up the size so that there are
only seven words on the first line of text.
That's really weird. I can read it without a problem. I must say however
that I calibrated my monitor with one of those test pattern DVDs, which
most likely causes my monitor to be set brighter than most people's.
What's with all you Heavy metal nuts (no pun intended) black and red do not
go together!


But it's so evil!!! :-)

Anyway, I'm gonna try some different colors now (suddenly I realize the
benefit of a stylesheet). I'll miss the red though...

Also thanks for the "box" suggestions. Sorry I asked it here, but I
wasn't aware that there is a seperate css ng...

Greetings
Tommy
Oct 16 '05 #6
David Ross wrote:

Also, a lack of
contrast between the text and the background might cause problems
for someone who is dyslexic.


You don't need to be dyslexic to have a problem with low-contrasting
colors. I see things like light gray text with a white background on
deezyner sites all the time. I don't know how *anyone* can read that
stuff. It's hard for me even at twice my normal text size. :(

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Oct 16 '05 #7
kchayka wrote:
David Ross wrote:
Also, a lack of
contrast between the text and the background might cause problems
for someone who is dyslexic.

You don't need to be dyslexic to have a problem with low-contrasting
colors.


Amen. Poor quality monitors or bad lighting can make things difficult
to see even for those with perfect eyesight. Using low contrast colours
for things that *should* stand out just adds to the problem.

[...]
--
Rob
Oct 18 '05 #8

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

Similar topics

0
by: VRandy | last post by:
Example: http://pages.prodigy.net/randyv/centerprb.htm The desired effect is a fixed width left margin with a fixed width div centered in the right side. If the browser is resized to become very...
5
by: Haines Brown | last post by:
I want a centered body, 680px wide, having a red bottom margin. The following works well in galeon, but not in IE5, where the bottom margin steals the full width of the viewpoint. That is, the red...
7
by: DaWoE | last post by:
Hi, I want to place a div centered of another div in IE. I get this to work in Mozilla, but not in IE. The code i use for mozilla is the following : <html> <head> <style type="text/css">
2
by: David Winter | last post by:
This is a totally trivial CSS problem, I'm sure, but I don't get it. I want a centered DIV with a fixed width between two other DIVs that should fill the rest of the window/viewport (= 100%). How...
4
by: Mimo Zus | last post by:
I'm hoping that someone can explain what's going on; better yet provide a workaround. I'm designing a centered CSS site based on a 550 pixel wide vertical background image. Onto this background...
17
by: Stian Lund | last post by:
Hello, I've been struggling with this problem for a while now, so I though I'd get some input from anyone more skilled with CSS than I am. I'm actually trying to accomplish two things with this:...
6
by: hiervision | last post by:
Hi I have a question about a CSS menu. I've got a 700 pixel table centered in the body of my page. The table scrolls quite a ways down. I would like to place a menu flush against the right...
9
by: Troy Piggins | last post by:
If I use the code: ----- <div style="text-align: center;"> <a href="photos.php?img=xx1.jpg"> <img src="xx1.jpg" style="padding: 10px;" /> </a> <a href="photos.php?img=xx2.jpg">
7
by: TheLongshot | last post by:
I just recently converted a few pages of my application to using master pages. Problem is, in all of my content pages, the contents are centered. I can't figure out why. The markup in the...
3
by: gentsquash | last post by:
I'm trying to display a paragraph that has a centered phrase, such as this one, in the middle of the paragraph. An example is the section "End of semester project" on my course-page ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
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...

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.