Border Size and Color help please!?

  • 1
  • Question
  • Updated 9 years ago
  • Answered
Is there a code for a border that stretches to 100% of the widget instead of having to know the size? I know that if you look at codes generated by other sources such as wufoo they'll include "maximum" fields which stretch fields to the "maximum" width. How can I create a border to do this?

Also, can you change the color of these borders?
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
  • http://youcanneverbetoosmart.com

Posted 9 years ago

  • 1
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
You can try changing the width to 100% instead of using px in your code. Alternatively, you could try using this code which automatically adjusts to the size of the columns.

Here's a code to change a background of a text box:

<div style="border: 1px solid black; padding: 10px; background-color: rgb(93, 196, 211); text-align: center;"><font size="3"><b>ABOUT ME<br></b></font></div>

You can change the following properties in the above code:
1. border
{1px} - width of border
{solid} - type of line shown - you can have dashed as well
{black} - color of the border

2. padding
{10px} - refers to the space between the text and the border

3. background-color
you can use rgb color or hex number

4. text-align
{center} - you can left or right align as well

5. font size
- ranges from 1 - 5

6. ABOUT ME - this is where you input your text
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
thanks littleus for this, when I was talking about the color, I was more specifically talking about the line of the border... instead of black. You have this option in excel and I was hoping there's some way to do it in html as well. I wonder if I copy and paste from excel (with a border of red for example) and then look at the html and see what they did to create the border change?
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
suprisingly, I was able to change the black to red and it changed the border.
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
and it appears that 100% does work

Thanks.

I kind of like the background color you used, it goes good with my site. It gave me an idea to use this as a main section title... but that's more work!
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Yes.. you can change the border color as you have discovered. You can also use hex numbers or rgb numbers as well to change the border color.

I'm glad to hear that the 100% worked.
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
yea, I know about hex colors and rgb :) thanks