CSS Solid Borders
Ranked #1,489 in Squidoo Community, #139,808 overall
Solid Line Borders Using CSS
2 Pixel Border
A solid border line
Use the following code:
<p style="border:2px solid #1a67b8;">A solid border line</p>
5 Pixel Border
A solid border line
Use the following code:
<p style="border:5px solid #1a67b8;">A solid border line</p>
10 Pixel Border
A solid border line
Use the following code:
<p style="border:10px solid #1a67b8;">A solid border line</p>
2 Pixel Line, Orange Color
Hexadecimal Orange (#ff9900)
Instead of using orange, I specified the exact color by using hexadecimal. In this case, I used the Squidoo orange color of #ff9900.
A solid border line with Squidoo orange color
Use the following code:
<p style="border:4px solid #ff9900;">A solid border line with Squidoo orange color</p>
10 Pixel Line, Orange Color
Hexadecimal Orange (#ff9900)
A solid border line with Squidoo orange color
Use the following code:
<p style="border:10px solid #ff9900;">A solid border line with Squidoo orange color</p>
8 Pixel Line, Text with Orange Background
A solid border line with Squidoo orange color background
Use the following code:
<p style="background-color:#ff9900; border: solid 8px green;">A solid border line with Squidoo orange color background</p>
The background-color:#ff9900; part is the orange background.
The border: solid 2px green; part is the 2 pixel solid line.
Solid Line with Height and Width
By adding a height and width (example: height:180px;width:90px;), I can change the dimensions of the solid lined rectangle.
A solid border line with height and width
Use the following code:
<p style="border: solid 8px green;height:180px;width:90px;">A solid border line with height and width</p>
Again, by adding a height and width (example: height:90px;width:200px;), I can change the dimensions of the solid lined rectangle.
A solid border line with height and width
Use the following code:
<p style="border: solid 8px green;height:90px;width:200px;">A solid border line with height and width</p>
Rounded Border
Blue, rounded solid line border
The rounded angles are formed using the moz attribute (think Mozilla), it displays as rounded when using Mozilla Firefox and a few other browsers.
- -moz-border-radius-topleft
- -moz-border-radius-topright
- -moz-border-radius-bottomleft
- -moz-border-radius-bottomright
Unfortunately, the moz attribute is not read properly by Internet Explorer, so the border will likely appear as right angles.
Use the following code:
<p style="border: 3px solid rgb(0, 102, 153); padding: 15px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; -moz-border-radius-topleft: 15px; -moz-border-radius-topright: 15px; -moz-border-radius-bottomright: 15px; -moz-border-radius-bottomleft: 15px; line-height: 20px; font-size: 15px; text-align: justify; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"> Blue, rounded solid line border</p>
8px blue border with Squidoo orange background
<p style="border: 8px solid rgb(0, 102, 153); padding: 15px; background-color:#ff9900; none repeat scroll 0% 0%; -moz-border-radius-topleft: 15px; -moz-border-radius-topright: 15px; -moz-border-radius-bottomright: 15px; -moz-border-radius-bottomleft: 15px; line-height: 20px; font-size: 15px; text-align: justify; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"> 8px blue border with Squidoo orange background</p>
Time for a little Q&A
Post your questions on this Squidoo topic below, and I'll do my best to answer them for you here.
-
Reply
-
DrSpuddinky
Jul 22, 2011 @ 8:45 am | delete
- Thanks very much - I wondered how people did this and now I can too! Great Lens!
-
-
Reply
-
tw006e6375
May 31, 2011 @ 3:21 am | delete
- Im a little thick when it comes to HTML and CSS i can understand, to a point, what the codes are but what I dont understand is how to use them. take pictures with my camera and download them onto my lens I now need to put boarders onto my pictures and titles can you help me please.Tom
-
-
Reply
-
bames24
Apr 25, 2011 @ 5:11 am | delete
- Thank you for the codes.. I have been wondering how the borders were done... :)
-
-
Reply
-
Beaddoodler
Mar 28, 2011 @ 8:19 am | delete
- Thanks for the CSS Codes. I haven't learned much CSS yet, still working mainly with HTML, but as I get time, I'd like to punch up my lenses a bit.
-
-
Reply
-
Mellony
Feb 21, 2011 @ 4:04 pm | delete
- Thanks for informative post !
-
-
Reply
-
HarmonyArtMom
Feb 11, 2011 @ 9:18 pm | delete
- Thanks for the easy to understand and useful lens.
Adding to my favorites.
-
-
Reply
-
WindyWinters
Jan 12, 2011 @ 1:16 pm | delete
- Thanks for this selection of borders. I'm going to experiment with them more this year! Happy New Year!
-
-
Reply
-
artyfax
Nov 24, 2010 @ 7:29 am | delete
- thanks for the code samples, will be sprinkling a few of these around my future (and a few existing) lenses
-
-
Reply
-
richiereveley
Oct 15, 2010 @ 11:59 pm | delete
- These are great.. I'll be adding some to my latest Lenses for sure :)
-
-
Reply
-
JJNW
Oct 12, 2010 @ 2:55 pm | delete
- This is EXACTLY what I needed to know. ADD MORE, ADD MORE! Learning so much!
-
- Load More
P.S. Still stuck?
Drop by our SquidU.com forum. Ask for help, don't be stingy, be sure to smile, and we're betting someone will come to the rescue. Explore related pages
- Squidoo CSS Borders Squidoo CSS Borders
- My Favourite CSS Tricks on Squidoo My Favourite CSS Tricks on Squidoo
- Squidoo Tools, Resources, and Guides Squidoo Tools, Resources, and Guides
- Lens Promotion and Traffic Generating Strategies Lens Promotion and Traffic Generating Strategies
- Squidoo Topics and How to Use Them! Squidoo Topics and How to Use Them!
- How to make a screenshot How to make a screenshot