5 2972
Abs wrote: Hi!
I'm having a little problem with my site. I know how to center DIVs using the "margin: auto" thing. But I'm unable to center two images. I used the "text-align: center" hack with no results, too.
Here is my site:
http://project.fotografist.com/
and the CSS:
http://project.fotografist.com/styles/styles_black.css
Basically, I need to center the images in the "photos" DIV.
Can someone help me, please ?
I'm not sure what it is you want: center them one below the
other? or next to each other?
You are using float:left on the div which surrounds the first
img, this will never get it centered. Float:left means left,
not centered.
Also you don't need to put divs around the img's, you can
apply the styles to the img elements themselves.
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Els wrote: I'm not sure what it is you want: center them one below the other? or next to each other?
yes, one next to the other.
You are using float:left on the div which surrounds the first img, this will never get it centered. Float:left means left, not centered. Also you don't need to put divs around the img's, you can apply the styles to the img elements themselves.
Ok, I'll try with no DIVs surrounding the images.
Abs wrote: Els wrote:
I'm not sure what it is you want: center them one below the other? or next to each other?
yes, one next to the other.
You are using float:left on the div which surrounds the first img, this will never get it centered. Float:left means left, not centered. Also you don't need to put divs around the img's, you can apply the styles to the img elements themselves.
Ok, I'll try with no DIVs surrounding the images.
Great, it works now. But I don't know if the text-align hack is the
right way to do it. Anyways...
Abs wrote: Abs wrote:
Els wrote:
I'm not sure what it is you want: center them one below the other? or next to each other?
yes, one next to the other.
You are using float:left on the div which surrounds the first img, this will never get it centered. Float:left means left, not centered. Also you don't need to put divs around the img's, you can apply the styles to the img elements themselves.
Ok, I'll try with no DIVs surrounding the images.
Great, it works now. But I don't know if the text-align hack is the right way to do it. Anyways...
You must notice though, that in IE, if the window is narrower
than the width of the two pictures, it won't be centered
anymore. In Gecko browsers, it will remain centered, thus
'losing' the left side of the left picture, where no scrollbar
will go. In IE, the left border of the left picture will stop
when touching the left side of the window, while the column
will remain centered.
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Abs wrote: Ok, I'll try with no DIVs surrounding the images.
I don't know if the text-align hack is the right way to do it.
IMG is inline by default, and text-align is for inline content, so it
is the right way to do it, and is not a "hack".
--
Brian (remove ".invalid" to email me) http://www.tsmchughs.com/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Heath |
last post by:
Is it proper to center images in a <div> by using the text-align: center
property? Or is there a better way?
|
by: Robert J. O'Hara |
last post by:
For some time I've made use of the max-width property in CSS to cause
my pages to appear as a centered block against a contrasting
background. This works well in new browsers (Mozilla, etc.) and falls
back fine in IE6 and lesser creations. As one who practices "classic"
(i.e. dull) typography, this has always been satisfactory since I've
always used one-column pages.
I'm now trying a two column layout so I can include a sidebar, and am...
|
by: John Pote |
last post by:
1. Horizontal centering a <divin browser window.
The current trend seems to be to place page content in a fixed width area in the middle of the
browser window. How is this achieved? If I use a top level <divthen I can place it with CSS
attribute 'left:', but this is a fixed offset. Is it possible to have a <divcentered in the
browser window?
2. Verticle centering in <div>
|
by: rsteph |
last post by:
I'm using two divs to create a shadowed-box type effect. Within the top div I want to put an image. I can get the image to center right to left, but not top to bottom. I'm making a series of boxes, and the images in them aren't all the same size. So I've sized the boxes to mach the largest of them, and I want to center them, so those that are smaller will be in the middle of the first div.
Here's the code on the page:
<table border="0"...
|
by: BT |
last post by:
I have taken over the support of an existing webpage and I need to revise
the page so that it is centered (left and right) on the screen instead of
aligned on the left. I can do this easily, but there is a little JavaScript
that doesn't work correctly after I center it.
I have tried to realign the page with either <centertag or align="left"
attribute, but the pictures displayed with the JavaScript get messed up with
everything I've...
| |
by: rudicheow |
last post by:
SHORT VERSION
=============
I have a bunch of identical fixed-size single-celled tables that rest
against each other horizontally thanks to "float:left". These tables
are dynamically generated and the number of them can vary greatly. They
are all contained within a parent table cell, which is centred on the
page. But I am unable to find a way of centering these table cells
within the parent cell.
|
by: tonsi |
last post by:
I have a page but it wont center the div. Can anyone take a look at it and help. When I try to center in the body using text-align: center; it doesn't work with the main container (called Table_01). Please help! I would be ever so greatful.
The page is located here:
http://www.cpiequipment.com/test_site/index.html
Here is the code:
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
|
by: issentia |
last post by:
I'm working on this site:
http://www.essenceofsoy.com/redesign/index2.html
and I'm having a few problems with getting the layout exactly right.
1) When the menu items are rolled over, they cannot be clicked as links unless the mouse pointer is below the word. This happens in both Firefox and IE6.
2) In Firefox, the pink quote banner and two gray form boxes above and below the content aren't centered in the "content" div, and I can't...
|
by: =?Utf-8?B?ZnJhbmt5?= |
last post by:
Hello,
I've created a table that has two rows that are span across three columns.
The third row has three columns, each with an image. The last row is also
span accross three columns. The span rows are centering their data.
however, the row with three columns, each with images (myimages1-3) are not
centering with the rest of the table. Any idea why?
Thanks in advance!
|
by: harryusa |
last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be horizonally and vertically centered within a <TD> </TD> area. No matter what I do the two image just present one above the other, albeit centered, NOT on top of each other.
I originally did the entire page layout in TABLES until I found out I.E. 7...
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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...
|
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,...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |