It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

DIV Tags

DIV Tags

Postby explorer07 on Thu Aug 09, 2007 1:38 pm

Hi all

I am kind of new to CSS. I have used DIV tags to contain a piece of text and an image extracted from a database (mysql). In the CSS I have defined the position as absolute for the DIV tags, however the height of the DIV section expands and contracts with the size of its content.

Is there way I can fix the length and the width of the div section?

Regards

explorer
explorer07
 
Posts: 23
Joined: Thu Aug 09, 2007 12:00 am

Postby DDragon on Fri Aug 10, 2007 2:29 am

you need to define the height and width of the div tags with
Code: Select all
width="100%" height="100%"
for a percentage of the whole page or
Code: Select all
width="100" height="100"
for exact pixels...
DDragon
50+ Club
 
Posts: 93
Joined: Wed Jun 20, 2007 12:51 am
Location: Australia

Postby knifeinback on Fri Aug 10, 2007 6:44 am

Don't do it that way.
Always define it in the DIVs CSS.
unless you're using generic DIV tags, then use the above.
User avatar
knifeinback
100+ Club
 
Posts: 136
Joined: Fri Jul 27, 2007 10:41 am
Location: 4170: Brisbane

Postby DDragon on Fri Aug 10, 2007 10:06 am

*re-looks over his initial response and hits head against a wall* lol god when I stuff up i do it royally lol sorry pay n\o heed to my ramblings lol :P
DDragon
50+ Club
 
Posts: 93
Joined: Wed Jun 20, 2007 12:51 am
Location: Australia

Postby explorer07 on Fri Aug 10, 2007 1:39 pm

Thanks dragon, I understood your first reposne I will try that. But I did not understand your recent post.

As for knifeback I think he was suggesting that I should have my DIV tags in the CSS file. Well I may do that eventually.

I really like this technology but I want to start using XML too.

Regards

Explorer
explorer07
 
Posts: 23
Joined: Thu Aug 09, 2007 12:00 am

Postby knifeinback on Sat Aug 11, 2007 10:32 am

Well, as a person who uses DIVs for everything (i fkn hate tables and all that, haha) I'll offer some advice.

I put all my general CSS (body etc) in a external file.
Then, I put all the CSS for the pages DIVs in the head tag of the page.

For some reason I find this easier if the DIVs tend to need the same postions (mainly) and maybe a few alterations from page to page, just copy, paste and change.

If all your DIVs are going to be the same for each page.
Just put them in the external file.

-----

If you're not actualy naming DIVs, and using the geric DIV tag.
Don't bother with css for DIV. Just use something like:

<div height="XXpx" width="XXpx"></div>

and so on.
hope that helps

-----

Also, for XML. www.w3schools.com will teach you what you need to know.
But considering your posts main topic, I think you mean XHTML.
User avatar
knifeinback
100+ Club
 
Posts: 136
Joined: Fri Jul 27, 2007 10:41 am
Location: 4170: Brisbane

Postby explorer07 on Sat Aug 11, 2007 2:18 pm

Well Knifeback, I prefer to put all my CSS in an external file. I usually have two, one for layout and the other for everything else. I dont like using the CSS on the page header, the embedded method. In fact I even prefer the inline method.

I also like DIVs rather than tables.

But do you know if I can restrict the number of words in my DIV tag which contains a piece of text that it is reading from the database. Basically I am reading four records into the DIV section and I want to assign them equal space inside the DIV tag.

No I meant XML and not XHTML. XML is far more versatile as it allows you to define the tags and I am looking at exchanging data between applications. But at this statge I will remain with CSS instead of XSTL.

Regards

Explorer
explorer07
 
Posts: 23
Joined: Thu Aug 09, 2007 12:00 am

Postby knifeinback on Sun Aug 12, 2007 6:48 am

Haha, Head CSS is hell easier if you have to change from page to page. Imo anyway.

I can't help there, sorry.
User avatar
knifeinback
100+ Club
 
Posts: 136
Joined: Fri Jul 27, 2007 10:41 am
Location: 4170: Brisbane


Who is online

Users browsing this forum: No registered users and 0 guests