Advanced css for squidoo - spice up your lens MORE
Ranked #1,695 in Squidoo Community, #168,599 overall | Donates to Inner-City Scholarship Fund
How to combine your css codes...
My lens about css for squidoo often gets the question: how do I combine the code?
This lens is an answer to that question. You'll learn about floats, and borders and colors and more. I hope it helps.
In practice I really hope you won't be using too much of this code on your lenses. Do float an image every once in a while. Don't spice things up with too many colors: the current Squidoo themes look great all on their own.
CSS simpler
So, you know what you're doing?
The code for the orange box is:
<p style="border: solid 10px #ff6600; padding: 10px">
Closing tag: </p>
The code for the blue background is:
Opening tag:
<p style="background: #E1E8F2; padding: 15px; margin: 0;">
Closing tag: </p>
To combine you have to look at each piece of the code...
Combining pieces of code
Padding is the room between the text and the border. Since it's always good to have space, let's pick the largest number:
padding: 15px.
The rest can just be added back to back, within the <p> (or paragraph) tag. Like so:
<p style="border: solid 10px #ff6600; background: #E1E8F2; padding: 15px; margin: 0;">
your text
closing tag: </p>
The general format is:
<p style=".....">your text here</p>
Which means it's all one paragraph (p).
border explained
So I've defined it as:
border: solid 10px #ff6600;
You can change the width of the border by playing with the amount of pixels.
For instance I could make a box with a very wide border by using 100px as width.
<p style="border: solid 100px #ff6600; padding: 10px">
Closing tag: </p>
That doesn't look very good, but it's an option.
Similarly the border might be 'dashed' or 'dotted'.
<p style="border: dashed 10px #ff6600; padding: 10px">
Closing tag: </p>
<p style="border: dotted 10px #ff6600; padding: 10px">
Closing tag: </p>
That dotted border doesn't even look all bad. Let's try it with less width (5px):
<p style="border: dotted 5px #ff6600; padding: 10px">
Closing tag: </p>
Or even less (1 pixel wide)
<p style="border: dotted 1px #ff6600; padding: 10px">
Closing tag: </p>
Using color
The border is orange, and the background is blue.
I'm using what's called 'hexadecimal' colors. I get those out of squidoo with the colorzilla addon for firefox.
You can use them in three places in squidoo code:
- The border of any paragraph (orange in our case)
- The background to a paragraph or piece of text
- The color of the text itself.
But CSS also leaves open the option to use color-names.
The border is SandyBrown, and the background is Beige and the text color (just called 'color' in the code) is peru.
<p style="border: solid 10px SandyBrown; background: Beige ;
padding: 15px; margin: 0;color: Peru">
</p>
Styling your text - fonts and font-weight and color combined
Several of my examples in my original CSS lens use different font-types.
Opening tag:
<p style="color: #1f94bf; font: 150%/1em 'courier new'; padding:
10px;">
You will notice I started out with color, as explained in my previous bit: this gives the color of the text.
Then comes 'font'. This is a handy tag in which you can define the size of the text and the font itself. In this case I went with:
- 150% larger than usual
- standard distance between lines : 2em would be more distance.
- 'courier new' font
You could change the font to Verdana, 200% and same distance between lines.
Opening tag:
<p style="color: #1f94bf; font: 200%/1em Verdana; padding:
10px;">
This is starting to look a bit crowded, so I upped the distance between lines:
This is starting to look a bit crowded, so I upped the distance between lines
Opening tag:
<p style="color: #1f94bf; font: 200%/2em Verdana; padding:
10px;">
Combining it all...
I went back to the colorscheme of earlier with a border which is SandyBrown, a Beige background a peru text color (just called 'color' in the code). Combining that with the font styling of the previous bit, this leads to the following code:
<p style="border: solid 10px SandyBrown; background: Beige ; padding: 15px; margin: 0;color: Peru; font: 150%/1em 'courier new'; ">
</p>
As you can see it's all lumped together in one paragraph:
<p style=".....">your text here</p>
Changing things around WITHIN a paragraph...
<p style="
This has the effect of styling a whole paragraph. Anything you embed in a paragraph tag (ending with the closing tag of course) will start on a new line and what comes after will be on a new line as well.
If you only want to style a word or a sentence within a paragraph, use the BOLD tag:
<b style="
For example, in this paragraph I've set the background to green, a yellow border and a light-blue color. Doesn't look very well. But this last sentence is totally different. It has a white color and a black background. That's because it's embedded in a BOLD tag. The code follows:
For the paragraph as a whole I used:
<p style="background: green; border: yellow; color: light-blue; font-weight: bold;"> text of the paragraph </p>
For the two sentences in white and black I used:
<b style="color: white; background: black"> text of the sentence </b>
More squidoo help lenses
Bonustip: making it float...
I went back to the colorscheme of earlier with a border which is SandyBrown, a Beige background a peru text color (just called 'color' in the code).
Making it float to the right...
<p style="border: solid 10px SandyBrown; background: Beige ; padding: 15px; margin: 0;color: Peru; font: 150%/1em 'courier new'; float: right; width: 50%;">
</p>
Here 'float: right' means that the whole paragraph goes to the right. Any other content, like this text, goes to the left, taking up whatever space is left.
In order for there to BE actual space left on the left, you should define the width of the paragraph. I usually define widths in percentages. So it's 50% of the total width of squidoo text.
However, you could change that.
floating to the left, width 30%
<p style="border: solid 10px SandyBrown; background: Beige ; padding: 15px; margin: 0;color: Peru; font: 150%/1em 'courier new'; float: left; width: 30%;">
</p>
This works alright, except that it becomes obvious we want more space between the colorful paragraph and the rest of the content.
floating to the left, width 30% - with a MARGIN
<p style="border: solid 10px SandyBrown; background: Beige ; padding: 15px; margin: 10px;color: Peru; font: 150%/1em 'courier new'; float: left; width: 30%;">
</p>
Aligning text & images
text centered
<p style="text-align: center">text centered</p>
Similarly, centering a picture works by adding those codes around the picture. Like this:
<p style="text-align: center"><img src="http://www.somethingorother.com/pictureJPG" /> </p>
This means that if you want to center a picture inside a paragraph, all the text in that paragraph will be centered. For instance if you were to give the paragraph a border, and have that border around all the text under the picture - there isn't a way to only center the picture and not the text. That is: unless of course you use the 'most important thing' module (but that limits the colors of the border to orange).
So here's how to center a picture in a paragraph that has been styled.
Lovely picture, isn't it?
<p style="text-align: center; background: #FCF8C0;border: dotted 2px #ff6600; "><img src="http://www.somethingorother.com/pictureJPG" />
Lovely picture, isn't it?</p>
How to change the font color within a paragraph
How to 'indent' on both sides of a paragraph
For instance, if you modify a padding setting like the following, you will have set a padding of 0px on top, 50px on the right, 10px below and 0px on the left:
padding: 0px 50px 10px 0px; put that in place of your usual padding settings and you will have 'indented' on the right.
Similarly, but outside of any background you may have set, you can modify the margin:
margin: 0px 50px 10px 0px;
Any questions?
Unfortunately changes in my personal life, and in the way squidu is managed, have made me decide to stop answering questions on that forum. I'm also too busy to answer questions elsewhere.I am available for consulting though, but that doesn't come cheap. For $99 you get a month of asking whatever questions you want and advice on your SEO strategy, link building, optimizing your blog etc. SEO consult online publishing.
If you aren't willing to pay up, you'll have to be content to stay updated on my Marketing Spiritual Blog where I am also willing to answer any questions related to the posts. It also contains a free ebook.
I'm active on twitter and facebook.
More Squidoo Help Lenses - squidoo answer deck etc.
Vote for your favorite squidoo answer deck lens (well, mine anyway)
squidoo css - my favorite code
I've gathered my favorite Squidoo-code for later r more...46 points
Lensrank explained (really)
Well, squidoo lensrank has, by common consensus, t more...45 points
SEO for squidoo - how to get google search traffic
SEO - search engine optimization - has many differ more...22 points
Advanced css for squidoo - spice up your lens MORE
My lens about css for squidoo often gets the quest more...16 points
Editing your squidoo lens - ideas
It's the last week of the month. To get your lense more...13 points
All Posters.Com the cutest affiliate program EVER
I do love this affiliate program. allPosters.com g more...12 points
How to do Keyword Research for squidoo
It is an under statement to say that keywords are more...11 points
Stumbleupon explained for lensmasters
Stumbleupon is great fun, and a tool for self-prom more...9 points
Squidoo money makers
This lens is meant to investigate what ways people more...9 points
If you want to become popular on squidoo...
In some ways squidoo is like a popularity contest. more...7 points
How to get found on Google - FAQ
Sorry people, I've become too busy to answer all y more...7 points
The Introduction Module in Squidoo
Squidoo recently changed the Introduction module. more...6 points
Would you rather have a squidangel blessing or a quality link?
Would you rather have a squidangel blessing or a q more...6 points
Optimizing tags for squidoo
Tags are a great way for websites like squidoo to more...6 points
SEO traffic stats: ranking report for squidoo lenses
Someone asked me to make a lens about my traffic s more...6 points
10 tips to get found in Google
SEO = Search Engine Optimization. In practice SEO more...6 points
Cute modules to spice up your lens
Cute modules that will help your lens stand out. G more...5 points
Human Forum Promotion
This lens is a list of tips for promoting your onl more...5 points
My Lenses Module on squidoo
My new favorite module is the My Lenses Module. No more...5 points
Why did I suddenly lose google traffic?
I hear this question so often in the Squidoo forum more...5 points
Google Blogsearch Module
I love to make a lens better by using google blog more...4 points
How to make a banner for your website or myspace
I make my own banners because I just don't want an more...4 points
More by me...
Contributors (by asking good questions)
New Featured Lenses
by squidoohelp
I've made a lot of lenses and a marketing blog to help you become a success on squidoo. I've even made my own Katinka's Squidoo Answer Deck - which is... more »
- 41 featured lenses
- Winner of 11 trophies!
- Top lens » SEO for squidoo - How to get google search engine traffic
Explore related pages
- Would you rather have a squidangel blessing or a quality link? Would you rather have a squidangel blessing or a quality link?
- Archive - Low votes in squidoo should be banned! Archive - Low votes in squidoo should be banned!
- Archive: Squidcasting - how to squidcast on squidoo Archive: Squidcasting - how to squidcast on squidoo
- Lens Promotion and Traffic Generating Strategies Lens Promotion and Traffic Generating Strategies
- Squidoo CSS - my favorite code to spice up a lens Squidoo CSS - my favorite code to spice up a lens
- Lensrank explained (really) Lensrank explained (really)