css question

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

css question

Post by tim »

I am no good with CSS... I have a textarea format :

Code: Select all

.texta {
background:#999999; 
color:white; 
font-family:verdana; 
font-size:7pt
}
A.) How do I align this to the center with inserting something into my Css... (I know I can use center tags but i want it with css)

B.) How can I make it so the textarea dont have a scroll option?

kudos.
User avatar
no_memories
Forum Contributor
Posts: 145
Joined: Sun Feb 01, 2004 7:12 pm
Location: New York City

Post by no_memories »

Are you talking about a form textarea or just a container <div> that centers in relation to the parent container?

A little more markup about what you are trying to accomplish would be helpful.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

Code: Select all

<form action=clear.php METHOD=GET><textarea name=comment class=texta cols=5 rows=2></textarea><BR><br><input type=submit class=logbutton value=Reset>

?>
User avatar
no_memories
Forum Contributor
Posts: 145
Joined: Sun Feb 01, 2004 7:12 pm
Location: New York City

Post by no_memories »

Ok,

The form and the text are both centered.

I'm guessing this is what you were inquiring about?

Code: Select all

<html>

<head>

<title></title>

<style type="text/css" media="screen">

#container &#123;
text-align: center;
&#125;

.texta &#123;
background:#999999;
color:white;
font-family: arial, helvetica, sans-serif;/* Verdana font is specific and will mess up in other operating systems besides windows, try using a generic font for interoperability */
font-size:11px; /* use px instead pt*/
text-align: center;
&#125;
</style>

</head>
<body>

<div id="container">
<form action="clear.php" method="get">
<textarea name="comment" class="texta" cols="50" rows="20"></textarea><br><br>
<input type="submit" class="logbutton" value="Reset"> 
</form>
</div>

</body>
</html>
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Verdana is installed on 90% of Mac systems and is more readable than Arial (only 3% more common).
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

And anyway that's the point of font cascading. If they don't have Verdana, it will cascade on down to Arial or whatever.

*notes that I'm typing this reply in Verdana.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

excellent...

but - how do I make it so the textarea has no scrollbars?
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

That would depend on the cols and rows and the size the textarea has to live in, as well as the browser (some browsers just really like to slap scrollbars on pretty much anything they can).

Do you mean actual scrollbars, or IE's nasty tendency to put dead scrollbars on the side of forms that don't even need to scroll? Or do you mean horizontal scroll bars?
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

nvm, i dont know why i wanted to use a textarea for what I wanted... I just wanted a place to insert a number that whatever number would reset my page counter... My approach is bad, I got it the way I wanted it.. I just used a simple:

Code: Select all

<?php
<input type="text" name="uname" maxlength="20" class="b0x" size="21" value="number here">
?>
dont ask me why I wanted a textarea, lol...

thanks for the help though, the centering part was useful as i'm a virgin CSS user pretty much... kudos
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

Post by uberpolak »

tim wrote:dont ask me why I wanted a textarea
Why'd you want a textarea?

All kidding aside, it's awesome that you're getting into CSS layouts, if everyone did that, I'd hate people slightly less. If you get stuck with various CSS issues, it's always a good idea to check http://www.alistapart.com/, they've covered a whole lot of things, and have code with explanations.

Once you think you've mastered this stuff, check out http://www.csszengarden.com/ for examples of how you can make CSS layouts kick ass. Pick through the code, it's so good that it'll shatter your confidence, but it's really useful if you're modest enough.

Note: I'm not associated with either of these sites in any way other than sexually.
User avatar
no_memories
Forum Contributor
Posts: 145
Joined: Sun Feb 01, 2004 7:12 pm
Location: New York City

Post by no_memories »

I didn't know that fact about Verdana!

Thanks Unipus.

But I have had no problems with using Arial on almost any system, Linux included.

The secret to font sizing is this:

in the global body use a fixed size, like

Code: Select all

body &#123;
font-size: 10px;
&#125;
When you need to make adjustments to other parts of the body, simply use a % value, like

Code: Select all

#menua &#123;
font-size: 120%;
&#125;
This takes care of about 95% of font sizing issues on various OS's.
Post Reply