Page 1 of 1

css question

Posted: Wed Feb 25, 2004 6:51 pm
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.

Posted: Wed Feb 25, 2004 7:03 pm
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.

Posted: Wed Feb 25, 2004 7:45 pm
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>

?>

Posted: Wed Feb 25, 2004 10:41 pm
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>

Posted: Thu Feb 26, 2004 3:49 pm
by Unipus
Verdana is installed on 90% of Mac systems and is more readable than Arial (only 3% more common).

Posted: Thu Feb 26, 2004 3:50 pm
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.

Posted: Thu Feb 26, 2004 4:47 pm
by tim
excellent...

but - how do I make it so the textarea has no scrollbars?

Posted: Thu Feb 26, 2004 4:58 pm
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?

Posted: Thu Feb 26, 2004 5:04 pm
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

Posted: Thu Feb 26, 2004 5:11 pm
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.

Posted: Thu Feb 26, 2004 6:36 pm
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.