This is a discussion on "Is it possible to align images in a div class?" within the Web Page Design section. This forum, and the thread "Is it possible to align images in a div class? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Is it possible to align images in a div class?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Is it possible to align images in a div class?
Is it possible to align an image in a div class?
I use some php to display some news items whcih uses a 2 different div classes alternating them so in theory in one class the image can be aligned right and the other class, the image aligned left. I don't know if this is even possible and how I do it. This is the php to alternate the div classes
|
|
|
|
#2
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
The two class definitions you give are the same so you only need one - .news
Then have two id definitions: #top, #bottom Now extend your defintion with two more:
|
|
#3
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
I don't know if this is the right forum but i did what you said...
i changed the div class to news and I added #top and #bottom. I have noticed however that only one div is displyed at a time and the other div seems to be hidden or not shown as i have about 18 records and only 9 are shown
Would it be easier to use a table instead? I didn't want to use a table becuase i was taught it was frowned upon by the w3c Last edited by AdRock; Jul 29th, 2006 at 23:21. |
|
#4
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
Can you post a link to the actual page so I can look at the html and css on my system? |
|
#5
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
i've attached the stylesheet and the page which is used to display the news items
the link to the page on my site is http://www.project-sw.co.uk/jack/ so you can see what i mean. If you click on menu item 3 and click newsitems you will see what I mean. The site is in it's developmental stage. Also can you have a look at the navigation. I have managed to underline the bullet (images) but would like the margin top and bottom spacing equal. I would think it's pretty simple but it's the last thing on my list to sort out. Thanks ukgeoff for all your help so far |
|
#6
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
Had a look at the scripts. CSS seems ok. In the php; This line - $t = mysql_query("SELECT * FROM `news`"); doesn't need the single quotes around 'news'. Where are the values for variables such as $limit coming from. I would be inclined to echo these values out to the screen and see if they are what you think they are supposed to be. I can see no obvious reason at the moment why you would get any number of news items less than what you are calculating. |
|
#7
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
I orignally put this code in but it would only align images on one side whereas I would like one image on the left and another image on the right as there would only be two items of news per page.
This code works perfectly if i didn't mind that
|
|
#8
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
You didn't actually answer my previous post. |
|
#9
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
I got the tutorial from http://www.allsyntax.com/tutorials/P...with-PHP/2.php
so i don't know about the variables. If i set the limit to 10 it will display 10 records per page I just tried this basic code and i noticed the first div is displayed but the second is not.
Last edited by AdRock; Jul 30th, 2006 at 23:37. Reason: update |
|
#10
|
|||
|
|||
|
Re: Is it possible to align images in a div class?
I got it sorted. i had to delete the dodgy id and change where I put the <div> tag and now it works....even though the timestamp is displayed anymore
|
![]() |
| Tags |
| possible, align, images, div, class |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] div class and div id | danny322 | Web Page Design | 1 | Nov 22nd, 2007 13:52 |
| Class of images... mental blank here... | minute44 | Web Page Design | 6 | Nov 7th, 2007 15:37 |
| array of class | janper | Flash & Multimedia Forum | 4 | Apr 9th, 2007 14:54 |
| creating new div class + making images links | TardPress | PHP Forum | 1 | Jun 19th, 2006 04:04 |
| Problems with defining class | jj1234 | Web Page Design | 3 | Feb 6th, 2006 08:47 |