Quick PHP(I think) question.

jtusa

Diamond Member
Aug 28, 2004
4,188
0
71
I'm loading a document into a div(using the php require function). I want to keep the div a certain size so I want it to be scrollable so you can still look at all the info.

There a way to do this?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
I don't think so unless it's a frame, textarea, or Flash object with built-in scrolling, but I'm far from being an HTML guru.
 

jtusa

Diamond Member
Aug 28, 2004
4,188
0
71
Originally posted by: DaveSimmons
I don't think so unless it's a frame, textarea, or Flash object with built-in scrolling, but I'm far from being an HTML guru.

Well what good are you then?? :p;)
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
divs dont have scroll bars :confused:
I'll concur with the above...only if you were to use an iframe IN the div or the like could it work properly
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
CSS is the answer!

you want the overflow function of css.
Add a css with overflow: auto, height, and width tags and apply that css to the div. It when then scroll when the content grows beyond the size constrants you have set.


*rant*

I'm amazed how little people seem to know about css. It is a standard after all and we see all these people preach about being so great. Yet very few people seem to know how to use it, or even use it at all. Any block element can use overflow (and thus have scrollbars). Even a paragraph tag can scroll. So frame out your content so it looks good in a text only browser, then make it look great with css (and possibly some javascript) in a graphical browser.

*Sub rant*

And please do not ever ever ever use tables to layout content.

* End sub rant*

*end rant*
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
^holy crap the man is right...i didn't know you could use divs like that :-O Props to sourceninja...may you keep teaching us stuff :D

I'll agree that I after working web dev for going on 5 years now have lacked in my CSS knowledge...CSS has so much to offer, its kinda like knowing all of C...and I'll even preach about it being great but still little things like this I have totally missed after all these years.

And please do not ever ever ever use tables to layout content.
ITs funny you say this...I've followed this motto for a while too...but recently i reviewed a book called "Professional Web Design and Development" and right there in chapter 1 was a section entitled : How use of tables can enhance your design...an entire chapter of using tables for layout
 

jtusa

Diamond Member
Aug 28, 2004
4,188
0
71
Originally posted by: sourceninja
CSS is the answer!

you want the overflow function of css.
Add a css with overflow: auto, height, and width tags and apply that css to the div. It when then scroll when the content grows beyond the size constrants you have set.


*rant*

I'm amazed how little people seem to know about css. It is a standard after all and we see all these people preach about being so great. Yet very few people seem to know how to use it, or even use it at all. Any block element can use overflow (and thus have scrollbars). Even a paragraph tag can scroll. So frame out your content so it looks good in a text only browser, then make it look great with css (and possibly some javascript) in a graphical browser.

*Sub rant*

And please do not ever ever ever use tables to layout content.

* End sub rant*

*end rant*

Don't use tables for layout, and I'm in the process of learning more CSS and PHP. As I need to do something I try to teach myself and if I can't I'll ask someone.

Thanks for the help.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
The problem with tables is the issues they cause with cell phone web browsers, text only browsers, low resolutions, and text to speach readers for the blind.

With css, you can write your page in such a way that it can be read by anything (just a nice list, title, links, body, footer). Then you can format the page to be perty. You save bandwith, the pages will load faster after the inital page (cause they can all use the same css file), and you can offer changes to your page to help assist people in reading it (dynamic text sizes, low bandwith pages, and printable formats).

It is a lot more work for the developer, but in the end its worth it.

In regards to my rant, I have no problems with people asking questions. I'm just surprised on how little people seem to know about css. So if you need any help, feel free to ask. I'll do my best to answer, or at least point you to the answer.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Feel free to rant all you want when providing good, useful info like this :)

Back when I was doing more HTML (a few years ago) CSS was not well supported on browsers, especially older browsers still installed on half of the customer machines.
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
Originally posted by: DaveSimmons
Feel free to rant all you want when providing good, useful info like this :)

Back when I was doing more HTML (a few years ago) CSS was not well supported on browsers, especially older browsers still installed on half of the customer machines.

lol ahh the good ol days...when everyone though Netscape 4.7 was the savior...i remeber when it was hyped almost as much as firefox is now...i think thats why i never devled into much CSS...after developing for that you kinda just loose all hope anything fancy will ever work cross platform/browser
 

igowerf

Diamond Member
Jun 27, 2000
7,697
1
76
Most of the web design firms that I've been interviewing at (I'm a recent college grad) want people who can do tableless design. A lot of major websites have also switched to tableless layouts (wired.com comes to mind).