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

[CSS] Centering a small block in a larger block

Hi,

This is actually two questions in one: how to have a block just fit the
data it contains (see my "table-cell" kludge) and how to have it centered
in a larger block?

My idea is to have my page split into two columns (each half as wide as the
whole page, this is the "bigblock" class), and to have in each of these
columns one, typically narrow, column (this is the "fitblock" class),
horizontally centered within its "bigblock" parent.

Unfortunately, http://yo.dan.free.fr/test.html doesn't work: the green box
is not centered inside its red block. Only <CENTER> is "powerful enough" to
get what I want: http://yo.dan.free.fr/test2.html. I would like to get rid
of this <CENTER> tag.

http://yo.dan.free.fr/test3.html shows that if I don't use

..fitblock { display: table-cell; }

"fitblock" expands and fills its containing "bigblock", nullifying any
attempt to center its content in the left half of the page.

Any solution to this problem? Is it possible to get rid of the "bigblocks"
and to correctly position my data (<ul>...</ul>) in the middle of the left
half of the page?

Cheers,
--
Daniel Déchelotte
http://yo.dan.free.fr/
Jul 23 '05 #1
1 1858
Daniel Déchelotte <ma**********@fr.club-internet.invalid> wrote:
[CSS]


Answered in the correct group:
comp.infosystems.www.authoring.stylesheets

--
Spartanicus
Jul 23 '05 #2

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

Similar topics

7
by: Erik Schulp | last post by:
Hi all, I am trying to get a CSS defined layout to center on the page, have tried doing this with the <center></center> tags but than everything is centered, including text etc etc. What...
3
by: Philip | last post by:
I am trying to replace extraneous tables with CSS but I am running into centering problems. I want pictures centered left to right (top aligned) in two columns, with the accompanying title and...
10
by: john T | last post by:
Is there anyway to vertically center a html table using css in such a way it does not alter the html table. When I tryied it just screws up.
13
by: Mike | last post by:
We are using: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"...
7
by: Steven (remove wax and invalid for reply) | last post by:
I'm moving an old page to a new host, and trying to modernize it at the same time. There are two little problems that are driving me nuts. 1. Validation of www.marzolian.com/index.html says: ...
1
by: Arnost Sobota | last post by:
Hello, I am aware that the correct way to center a block-level element is to set the left and right margins to auto. However, this seems to only if the element to be centered has a width...
4
by: gomesbascoy | last post by:
I'm trying to do that, like a 3x3 table (with specific width and height) BUT whit divs and without absolute position.... this is my imposible mission xD example:
14
by: Summercool | last post by:
in http://www.0011.com/test_size3.html to center the logo "HTML 4.01 check" button at the bottom of the page, I used <div style="width: 10px; margin: 0px auto"> </div>
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
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: 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: 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
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,...

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.