473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Moving code from external stylesheet to internal

Hi
I have this entry in my stylesheet main1.css:

#head {
width: 310px;
height: 60px;
float: left;
display: block;
background-image: url(logo.jpg);
background-position: left top;
background-repeat: no-repeat;
}

I am trying to move it into the web page code for Search Engine
Optimisation purposes, thus:

<div id="head-logo" style="width:31 0px; height:115px; float:left;
background-position: left top; display:block;" ><img src="logo.jpg"
width="178" height="59" alt="Driving Instructor Insurance - Instructor
Cover"></div>

The logo in the revised version comes out an inch or so to the right
of its previous position. What am I doing wrong?

Stapes

Aug 6 '07 #1
14 3149
On 6 Aug, 14:34, Stapes <steve.sta...@g mail.comwrote:
I have this entry in my stylesheet main1.css:
I am trying to move it into the web page code for Search Engine
Optimisation purposes, thus:
Ridiculously pointless, so stop trying to do that.

Just where did you find this crazy piece of wrong-headed voodoo?

Aug 6 '07 #2
Stapes wrote:
"Beauregard T. Shagnasty" wrote:
>Why? Do you think people search for .. "width:310p x" ?

No - I am hoping they might pick up the alt text to the image.
The alt text should be in the HTML <imgelement (where it is), and
isn't part of your style sheet, or inline style. They will find it,
regardless of your styling method.

....
Yes - I have not tampered with the original style sheet. So I have
given my div a different name because I am no longer using the css
file version.
It would be less than desirable to fill all your pages with the same
styles. There is a considerable ease to maintenance if you use one
external style sheet, and less of a burden to people downloading the
pages.
>..so it would be best if you could provide URLs to the two test
cases, instead of relying on possibly incomplete code snippets here.
Other things might be the reason, such as the DOCTYPE in use.

The URL is http://www.instructorcover.co.uk/index.aspx. Compare with
Is this a new site/page? If so, it should use a Strict doctype, as you
aren't Transitioning from anything, such as a legacy page.

http://www.w3.org/QA/2002/04/valid-dtd-list.html

You seem to be on the XHTML bandwagon, though most will recommend using
HTML 4.01 Strict.

You will also want to drop the HTML prolog
(<?xml version="1.0" encoding="iso-8859-1"?>)
as having anything preceding the DOCTYPE will throw IE6 into quirks
mode.
http://www.instructorcover.co.uk/about us.aspx, which uses the CSS
file, but has the same heading.
"about us.aspx" not found. Neither was "about_us.aspx" ,
"about-us.aspx", "aboutus.as px" or "about".

--
-bts
-Motorcycles defy gravity; cars just suck
Aug 6 '07 #3
On 6 Aug, 15:55, "Beauregard T. Shagnasty"
<a.nony.m...@ex ample.invalidwr ote:
Stapes wrote:
"Beauregard T. Shagnasty" wrote:
Why? Do you think people search for .. "width:310p x" ?
No - I am hoping they might pick up the alt text to the image.

The alt text should be in the HTML <imgelement (where it is), and
isn't part of your style sheet, or inline style. They will find it,
regardless of your styling method.
Surely not! - where is the alt text in this:

#head {
width: 310px;
height: 60px;
float: left;
display: block;
background-image: url(logo.jpg);
background-position: left top;
background-repeat: no-repeat;
}

>
...
Yes - I have not tampered with the original style sheet. So I have
given my div a different name because I am no longer using the css
file version.

It would be less than desirable to fill all your pages with the same
styles. There is a considerable ease to maintenance if you use one
external style sheet, and less of a burden to people downloading the
pages.
..so it would be best if you could provide URLs to the two test
cases, instead of relying on possibly incomplete code snippets here.
Other things might be the reason, such as the DOCTYPE in use.
The URL ishttp://www.instructorc over.co.uk/index.aspx. Compare with

Is this a new site/page? If so, it should use a Strict doctype, as you
aren't Transitioning from anything, such as a legacy page.

http://www.w3.org/QA/2002/04/valid-dtd-list.html

You seem to be on the XHTML bandwagon, though most will recommend using
HTML 4.01 Strict.

You will also want to drop the HTML prolog
(<?xml version="1.0" encoding="iso-8859-1"?>)
as having anything preceding the DOCTYPE will throw IE6 into quirks
mode.
http://www.instructorcover.co.uk/aboutus.aspx, which uses the CSS
file, but has the same heading.

"about us.aspx" not found. Neither was "about_us.aspx" ,
"about-us.aspx", "aboutus.as px" or "about".
http://www.instructorcover.co.uk/about%20us.aspx
>
--
-bts
-Motorcycles defy gravity; cars just suck

Aug 6 '07 #4
On 6 Aug, 15:51, Andy Dingley <ding...@codesm iths.comwrote:
On 6 Aug, 14:34, Stapes <steve.sta...@g mail.comwrote:
I have this entry in my stylesheet main1.css:
I am trying to move it into the web page code for Search Engine
Optimisation purposes, thus:

Ridiculously pointless, so stop trying to do that.

Just where did you find this crazy piece of wrong-headed voodoo?
Just about everyone but you.

Wrong-headed voodoo saint.
Aug 6 '07 #5
Stapes wrote:
On 6 Aug, 15:55, "Beauregard T. Shagnasty"
<a.nony.m...@ex ample.invalidwr ote:
>Stapes wrote:
>>"Beauregard T. Shagnasty" wrote:
Why? Do you think people search for .. "width:310p x" ?
No - I am hoping they might pick up the alt text to the image.
The alt text should be in the HTML <imgelement (where it is), and
isn't part of your style sheet, or inline style. They will find it,
regardless of your styling method.

Surely not! - where is the alt text in this:

#head {
width: 310px;
height: 60px;
float: left;
display: block;
background-image: url(logo.jpg);
background-position: left top;
background-repeat: no-repeat;
}
Nowhere, it'd be in the <div id="head"><img src="" alt =""></div>
if you had one.

You misunderstand Beauregard, but he misunderstood you. I think you
misunderstood him through either careless reading or a lack of
experience. I reckon he misunderstood you because you want something so
weird, and your initial explanation didn't make it clear.

You want a logo to be in the markup (instead of being a BG image) so
that you can provide an alt image, in the rather twisted belief that
search engines will see the alt property and drive traffic to your site
and you will become rich beyond your dreams. Or something.

Don't do that. It's perverted. You're messing up (and bulking up) the
markup when the logo is really just decorative. It's not content, so
leave it out of the content (HTML). It belongs in the CSS, so leave it
there.

"Driving Instructor Insurance - Instructor Cover" is terrible (morally
invalid) alt text anyway. I'm blind to the image in question, and this
alt text is wholly inadequate to convey to me what the missing image
represents.

BTW, you can omit the background-position: left top; display:block; in
your first inline attempt (your OP). You've got no background image in
that case, so background-position is meaningless. And the div is
probably display:block by default, so skip that too.

Best of all, though, leave the logo as a BG image in the CSS.
>...
In future, please trim content unnecessary to your response.

--
John
Pondering the value of the UIP: http://blinkynet.net/comp/uip5.html
Aug 6 '07 #6
On 6 Aug, 16:28, John Hosking <J...@DELETE.Ho sking.name.INVA LID>
wrote:
Stapes wrote:
On 6 Aug, 15:55, "Beauregard T. Shagnasty"
<a.nony.m...@ex ample.invalidwr ote:
Stapes wrote:
"Beauregard T. Shagnasty" wrote:
Why? Do you think people search for .. "width:310p x" ?
No - I am hoping they might pick up the alt text to the image.
The alt text should be in the HTML <imgelement (where it is), and
isn't part of your style sheet, or inline style. They will find it,
regardless of your styling method.
Surely not! - where is the alt text in this:
#head {
width: 310px;
height: 60px;
float: left;
display: block;
background-image: url(logo.jpg);
background-position: left top;
background-repeat: no-repeat;
}

Nowhere, it'd be in the <div id="head"><img src="" alt =""></div>
if you had one.

You misunderstand Beauregard, but he misunderstood you. I think you
misunderstood him through either careless reading or a lack of
experience. I reckon he misunderstood you because you want something so
weird, and your initial explanation didn't make it clear.

You want a logo to be in the markup (instead of being a BG image) so
that you can provide an alt image, in the rather twisted belief that
search engines will see the alt property and drive traffic to your site
and you will become rich beyond your dreams. Or something.

Don't do that. It's perverted. You're messing up (and bulking up) the
markup when the logo is really just decorative. It's not content, so
leave it out of the content (HTML). It belongs in the CSS, so leave it
there.

"Driving Instructor Insurance - Instructor Cover" is terrible (morally
invalid) alt text anyway. I'm blind to the image in question, and this
alt text is wholly inadequate to convey to me what the missing image
represents.

BTW, you can omit the background-position: left top; display:block; in
your first inline attempt (your OP). You've got no background image in
that case, so background-position is meaningless. And the div is
probably display:block by default, so skip that too.

Best of all, though, leave the logo as a BG image in the CSS.
...

In future, please trim content unnecessary to your response.

--
John
Pondering the value of the UIP:http://blinkynet.net/comp/uip5.html- Hide quoted text -

- Show quoted text -
Well John,
we paid for a report from Neutralize: Independent Internet Marketing
Services, who say this:

The present top header should be seperated so that the logo can be
used as a home page link, this would enable the optimisation of the
page with added alt text; alt tag and link can then be applied.

What exactly do you mean by 'morally invalid'? Is there anything
morally valid about car insurance?

Stapes

Aug 6 '07 #7
Stapes wrote:
"Beauregard T. Shagnasty" wrote:
>Stapes wrote:
>>"Beauregard T. Shagnasty" wrote:
Why? Do you think people search for .. "width:310p x" ?
>>No - I am hoping they might pick up the alt text to the image.

The alt text should be in the HTML <imgelement (where it is), and
isn't part of your style sheet, or inline style. They will find it,
regardless of your styling method.

Surely not! - where is the alt text in this:
I was referring to the: alt="Driving Instructor Insurance - Instructor
Cover" in your sample in your first post.
#head {
width: 310px;
height: 60px;
float: left;
display: block;
background-image: url(logo.jpg);
background-position: left top;
background-repeat: no-repeat;
}
You can't place alt text on a *background* image, no matter how you call
it.

Try changing
margin-left: auto;
to
margin-left: 0px;
in
#Heading { ...

Hopefully, you will study the rest of my points.

--
-bts
-Motorcycles defy gravity; cars just suck
Aug 6 '07 #8
Stapes wrote:
On 6 Aug, 15:51, Andy Dingley <ding...@codesm iths.comwrote:
>On 6 Aug, 14:34, Stapes <steve.sta...@g mail.comwrote:
>>I have this entry in my stylesheet main1.css:
I am trying to move it into the web page code for Search Engine
Optimisatio n purposes, thus:

Ridiculously pointless, so stop trying to do that.

Just where did you find this crazy piece of wrong-headed voodoo?

Just about everyone but you.

Wrong-headed voodoo saint.
I agree with Andy.

As stated (or implied), Google will read the external style sheet for
every page it attempts to index. It does not need to be within the
separate page code itself. (Another SEO scam bites the dust?)

--
-bts
-also a wrong-headed voodoo saint?
Aug 6 '07 #9
There is no such thing as alt text in CSS
............... ............... ............... ............... ............... ............... .........
"Stapes" <st**********@g mail.comwrote in message
news:11******** **************@ o61g2000hsh.goo glegroups.com.. .
>
Surely not! - where is the alt text in this:

#head {
width: 310px;
height: 60px;
float: left;
display: block;
background-image: url(logo.jpg);
background-position: left top;
background-repeat: no-repeat;
}

>>
...
Yes - I have not tampered with the original style sheet. So I have
given my div a different name because I am no longer using the css
file version.

It would be less than desirable to fill all your pages with the same
styles. There is a considerable ease to maintenance if you use one
external style sheet, and less of a burden to people downloading the
pages.
>..so it would be best if you could provide URLs to the two test
cases, instead of relying on possibly incomplete code snippets here.
Other things might be the reason, such as the DOCTYPE in use.
The URL ishttp://www.instructorc over.co.uk/index.aspx. Compare with

Is this a new site/page? If so, it should use a Strict doctype, as you
aren't Transitioning from anything, such as a legacy page.

http://www.w3.org/QA/2002/04/valid-dtd-list.html

You seem to be on the XHTML bandwagon, though most will recommend using
HTML 4.01 Strict.

You will also want to drop the HTML prolog
(<?xml version="1.0" encoding="iso-8859-1"?>)
as having anything preceding the DOCTYPE will throw IE6 into quirks
mode.
>http://www.instructorcover.co.uk/aboutus.aspx, which uses the CSS
file, but has the same heading.

"about us.aspx" not found. Neither was "about_us.aspx" ,
"about-us.aspx", "aboutus.as px" or "about".

http://www.instructorcover.co.uk/about%20us.aspx
>>
--
-bts
-Motorcycles defy gravity; cars just suck

Aug 6 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2395
by: Douglas Reith | last post by:
Hi There, Can someone please tell me why the XML spec states that an attribute value with an external entity is forbidden? Or point me to the appropriate document? Or better still, perhaps you know of a work around? It is a little frustrating that the normally powerful external entities are limited in this fashion. Example (myextent.txt contains just one word without a CR):
3
12823
by: allard poldermans | last post by:
How can I make a reference to an external CSS or JS file that is relative to the XSL stylesheet, and not relative to the XML data? If you simply put : <link rel="stylesheet" type="text/css" href="ui/demo.css" ></link> in your XSL file, this link will always be relative to the location where the XML file is. For example, suppose I have following XML data (test.xml):
1
6597
by: Razvan | last post by:
Hi What is the difference between an internal and an external entity ? The first one is defined in the internal subset (not in a separate DTD file, but in the XML file itself - in DOCTYPE) while the second one is defined in the external subset (in a separate DTD file) ? Or an
6
3424
by: Christopher Benson-Manica | last post by:
Just FMI, if an external stylesheet is linked to a page (with <link>), will subsequent <style> tags override the values in the external stylesheet? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
2
2255
by: Markus Ernst | last post by:
Hi I build a small content management system. I use different external stylesheets for the admin section and the frontend, called admin.css and frontend.css. Now I would like to preview some frontend stuff in the admin section. Is there a syntax for accessing a style from a different style sheet? For example:
12
3095
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application { BACKGROUND-IMAGE:url(/someImage.jpg); }
3
6038
by: al.cpwn | last post by:
do static and inline functions or members have internal linkage? I have been reading this newsgroup on google and found conflicting ideas. Can someone please help me understand why in some places inline may have external linkage while in others it has internal (from what I have read in comments by people). Are there any (other) places where linkage is ambiguous?
14
3571
by: rabbitrun | last post by:
Hi Everyone, I work for a financial company. I am planning to give a presentation to rest of the development team (15 people) here on moving server side logic to client-side javascript for an internal intranet application rewrite. This approach will definitely stir up hot debate from hardcore server-side Java folks who wants to do UI stuff even on the server!. Since I am pretty much known as the JS or UI Guy of the group, my Boss...
10
2412
by: Stefan Weber | last post by:
Hi, I'm trying to access the JavaScript code contained in a <scripttag via its "text" attribute. This works well, if the code is embedded in the HTML page. However, when the code is in an external file with the "src" attribute, it does not work anymore. Does anybody have an idea if there is any way (be it clean and simple or as a workaround) to access the code of external scripts as well? I read, that if there is something like
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.