html code break |
html code break |
mummys revenge |
Sep 21 2006, 06:43 PM
Post
#1
|
Group: Members Posts: 2 Joined: 21-September 06 Member No.: 195 |
Can anyone tell me, since we had to break up the "W" in Welcome, due to web design, will that matter as far as a search engine goes, will it reckognize at the word welcome or 2 words the "W" and "elcome"?
<!-- #BeginEditable "title" --> <div class="titleLeft"> W </div> <div class="titleRight"> elcome </div> <!-- #EndEditable --> THANKS! |
pandy |
Sep 21 2006, 06:55 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
Not that I know for sure, but I would assume two words since DIV is block level. Much the same as putting the W in its own paragraph. Why don't you use a more appropriate element than DIV for the whole welcome, a SPAN for the W and CSS for layout? Since I don't know the context I don't know if a heading or a para would be the best choice, but let's assume a para.
<p> <span style="display: block">W</span>elcome</p> |
Darin McGrew |
Sep 21 2006, 07:28 PM
Post
#3
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
I'm not sure what search engines and the like do now, but in the past, they treated all those examples as two words: "W" and "elcome"
Can you use the CSS first-letter pseudo-element for this? That leaves your markup intact, but allows you to style the first letter differently. |
pandy |
Sep 21 2006, 08:10 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
I didn't know that. Bummer.
I don't think first-letter works. It's supposed to be possible to use for example line-height and margins with it, but last I checked browsers didn't agree. |
Darin McGrew |
Sep 21 2006, 11:50 PM
Post
#5
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
I just tried a simple test with p:first-letter and Opera 9.01, FireFox 1.0.2, and MSIE 6.0 all did the right thing with it.
|
pandy |
Sep 22 2006, 12:32 AM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
So what did you do?
|
Darin McGrew |
Sep 22 2006, 12:37 AM
Post
#7
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Nothing fancy, but
CODE p:first-letter { worked fine for me.font-size: 200%; color: red; } |
Darin McGrew |
Sep 22 2006, 12:42 AM
Post
#8
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
I just tried
CODE p:first-letter { and it worked in the same three browsers.font-size: 300%; color: red; background: green; display: block; float: left; clear: left; padding: .25em; } |
pandy |
Sep 22 2006, 12:44 AM
Post
#9
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
Yes, but that doesn't look like a line break. A negative top margin or possibly increased line-height combined with vertical-align would, but they don't work.
|
Darin McGrew |
Sep 22 2006, 03:00 AM
Post
#10
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
I really have no idea what the OP wanted to do. Maybe browsers will support it. Maybe they won't. But to me it looks like the first-letter pseudo-element is fairly well supported, so there shouldn't be a need to split up the first word of a paragraph just to do something special with the first letter.
|
pandy |
Sep 22 2006, 03:08 AM
Post
#11
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
I thought he wanted the W on its own "line" but maybe I interpreted the subject wrongly.
Hey, mummys revenge. What do you want to do with the W? |
Christian J |
Sep 22 2006, 05:41 AM
Post
#12
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
Regarding search engines I think the issue is moot, for who would search for such a common word as "Welcome"? Also it's often adviced not to write "welcome" at all on web pages, since it's redundant.
I just tried CODE p:first-letter { and it worked in the same three browsers.font-size: 300%; color: red; background: green; display: block; float: left; clear: left; padding: .25em; } 'display: block' is not listed at http://www.w3.org/TR/CSS21/selector.html#first-letter , OTOH it says "UAs may apply other properties as well". I should add that my browsers don't support it either. This post has been edited by Christian J: Sep 22 2006, 06:43 AM |
mummys revenge |
Sep 22 2006, 12:13 PM
Post
#13
|
Group: Members Posts: 2 Joined: 21-September 06 Member No.: 195 |
It is on a color box on a web page, and if you out the whole word together it messes up the line and looks bad. So if you seperate them it makes for a clean break.
Regarding search engines I think the issue is moot, for who would search for such a common word as "Welcome"? Also it's often adviced not to write "welcome" at all on web pages, since it's redundant. I just tried CODE p:first-letter { and it worked in the same three browsers.font-size: 300%; color: red; background: green; display: block; float: left; clear: left; padding: .25em; } 'display: block' is not listed at http://www.w3.org/TR/CSS21/selector.html#first-letter , OTOH it says "UAs may apply other properties as well". I should add that my browsers don't support it either. |
Darin McGrew |
Sep 22 2006, 12:16 PM
Post
#14
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Ah, maybe I was just seeing it float. Sorry for any confusion.
|
pandy |
Sep 22 2006, 12:23 PM
Post
#15
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
|
Lo-Fi Version | Time is now: 28th March 2024 - 03:29 PM |