473,804 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8830
TomB <dr******@dus k-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.infosystem s.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.infosystem s.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.infosystem s.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_col or_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
1947
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 narrow (less than 640px in this example), the right side centered div should stop at the margin and horizontal scroll bar appear as the window gets extremely narrow. IE6 and Opera 4.11 display all the examples the same way. The top row is a...
5
2497
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 line stretches from one side of the screen to the other and is not 680 pixels long. Why isn't the bottom margin 680 pixels? body { ... width: 680px; margin-top: 1em;
7
10118
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
5489
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 do I achieve this? I tried width:auto for the buffer DIVs, but it didn't work. This should at least work in IE 5.5 and Opera. A totally standards-compliant solution would be appreciated, of course ... :/ This is waht I have:
4
9734
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 I built a two column layout with nested navigation and content divs. The background image is centered via "background: ... center;", the divs are centered over it via "margin: 0 auto 0 auto;". The problem I'm having in IE6 is inconsistent...
17
2276
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: 1. Create a floated image with text around, with a caption centered underneath. Image size can be varied but the caption needs to have a fixed size to make it break correctly I think. I also need the image to resize automatically when the...
6
2230
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 side of that table, centered vertically, which does not move when the user scrolls down. Obviously, it would need to stay flush against the centered table as it is resized in either
9
2525
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
2029
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 content page seems to ignore any attempts to manually align right. So what's the deal?
3
2320
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 http://www.math.ufl.edu/~squash/course.calc3.html
0
9577
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.