/    Sign up×
Community /Pin to ProfileBookmark

Can You Make a Scroll Bar with PHP?

I want my div on my staff page to have a scroll bar. It has one using CSS, but for some reason, that bit of code doesn’t work in Internet Explorer.

Is there a way to use PHP to make a scroll bar for your div?

to post a comment
PHP

12 Comments(s)

Copy linkTweet thisAlerts:
@ZnupiFeb 20.2008 — No.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorFeb 21.2008 — Then what would you use? Surely there's a way to make a scroll bar that will work in IE?
Copy linkTweet thisAlerts:
@ZnupiFeb 21.2008 — Yes. With CSS, for example:
<i>
</i>div.scrollbar {
height: 30px;
overflow: auto;
}
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorFeb 21.2008 — I can take a screen shot if you like, but it doesn't work ?

What version of Explorer are you using? I'm using version seven.
Copy linkTweet thisAlerts:
@ZnupiFeb 21.2008 — http://znupi.ath.cx/temp/test.html

Works for me in IE6, IE7, Firefox, Opera, Safari. Here's the code:

[code=html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled Template</title>
<style type="text/css">
div.scrollbar {
height: 100px;
overflow: auto;
border: solid 1px #000;
padding: 5px;
}
</style>
</head>
<body>
<div class="scrollbar">text<br>text<br>text<br>text<br>text<br>text<br>text<br>text<br>text<br>text</div>
</body>
</html>[/code]

?
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorFeb 21.2008 — Still isn't working...

Would not using a doctype declaration affect that?
Copy linkTweet thisAlerts:
@ZnupiFeb 21.2008 — Maybe, I don't know. But you should always use a doctype.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorFeb 21.2008 — I know I should, and I fully plan on adding one at some point. The reason I don't use one now is because I use the scrolling marquee tag on my site for a news ticker, which isn't standard HTML. It used to only work in IE, but many browsers (Firefox, Safari, and Opera) have come to support it as well. I'm going to switch to a JavaScript news ticker at some point, so I'll be able to use a doctype. I don't know JavaScript real well yet, so that's why I'm waiting. I'm sure I can find one online, but I want to hard code it myself, because I learn a lot better that way.
Copy linkTweet thisAlerts:
@ZnupiFeb 21.2008 — And why not use a doctype anyway? Does it break the marquee? I don't think it should..
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorFeb 21.2008 — I used the HTML 4.01 loose doctype once, and the marquee wouldn't scroll. I always thought that you couldn't use non-standard HTML with a doctype?
Copy linkTweet thisAlerts:
@ZnupiFeb 21.2008 — That all depends on the browser ?
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorFeb 21.2008 — I'll test it again. I know it didn't work in Firefox at the time...

Pretty much it sounds like I loose either way:p
×

Success!

Help @Joseph_Witchard spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.9,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...