473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Tag nesting problems (in content management system)

Hi everyone,

I am trying to debug someone's site which has

<h3><a href="www.legislation.qld.gov.au">Queensland Acts</a></h3>

The problem is that the <a> tag is taking precedence and overriding
the <h3> tags that they want the text to resemble.

It's problematic because it's a huge site (around 500 pages), it's in
MS Content Management Server 2002 (which means I can't access more
than one page at any one time - no global find/replace!, and templates
mean I have no access to the <head>) and this is occuring throughout
with all H1, H2, H3 tags that have an <a> within. Also because it's a
content management server, it's all been done through a user authoring
interface that automatically nests the tags in this order. Messy!!

I have tried using the !important tag in external CSS to give the
heading tags precedence over the <a> but it isn't working. Is there
any way I can force the <H3> to override the <a> when they are ordered
like this?

Thanks
Jul 20 '05 #1
9 2925
jetobe wrote:

<h3><a href="www.legislation.qld.gov.au">Queensland Acts</a></h3>

The problem is that the <a> tag is taking precedence and overriding
the <h3> tags that they want the text to resemble.
As it should.
because it's a content management server, it's all been done
through a user authoring interface that automatically nests the
tags in this order. Messy!!
No, not messy. Conforming. <a><h3>heading</h3><a> is illegal syntax.
Is there any way I can force the <H3> to override the <a> when they
are ordered like this?


You can't force anything on the web. But the following css should
give you better results:

h3 a { color: blue; }

Since your question is about css, why did you x-post to ciwah?
(f'ups set)

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2
Brian <us*****@julietremblay.com.invalid-remove-this-part> wrote:
jetobe wrote:

<h3><a href="www.legislation.qld.gov.au">Queensland Acts</a></h3>

The problem is that the <a> tag is taking precedence and overriding
the <h3> tags that they want the text to resemble.
As it should.


Well, in a sense, yes. Tags don't really _do_ anything. But browsers
naturally apply their default rules for links, whether the links appear
inside headings or not.

By the way, the href value is almost surely wrong. We seem to have got
a _distorted_ snippet of markup instead of a URL that would tell what the
situation really is.
But the following css should
give you better results:

h3 a { color: blue; }


Some some strange value of "better". Now if the user's browser has settings
that use green color for unvisited links and gray color for visited links,
the user will be mislead into thinking that it's not a link at all.
(I'm pretty sure that I'm right in guessing that the author has
"successfully" removed the underlining of links.)

Strange things will also happen when the user has set blue background and
white and yellow text colors for links.

And for the great _majority_, the vital distinction between unvisited and
visited links would be lost.

Links want to be links. (See http://www.cs.tut.fi/~jkorpela/www/links.html )
Don't play with their appearance unless you are doubly sure of what you are
really doing.

It's questionable whether links should appear in headings, but in some cases
(e.g., a heading is a news headline, followed by a short version of the
news, and the heading is a link to the full version) it's quite OK. And in
those cases it is vital that they _look_ like links.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3
jetobe wrote:
I am trying to debug someone's site which has

<h3><a href="www.legislation.qld.gov.au">Queensland Acts</a></h3>

The problem is that the <a> tag is taking precedence and overriding
the <h3> tags that they want the text to resemble.
You mean there are styles applied to <a> elements that you don't want to
apply to <a> elements within <h3> elements?

Also because it's a content management server, it's all been done through
a user authoring interface that automatically nests the tags in this
order. Messy!!
No, /valid/. <a> elements cannot contain <h3> elements, if you were
thinking about changing the documents in that way.

I have tried using the !important tag in external CSS to give the
heading tags precedence over the <a> but it isn't working.
It shouldn't. The !important declaration means that it should take priority
over user declarations in some cases. It's got nothing to do with making
elements inherit their parent's styling.

Is there any way I can force
You can't force anything. You can only suggest.

the <H3> to override the <a> when they are ordered like this?


Simply construct an appropriate selector and style matching elements
appropriately:

h3 a {
/* Your styles here */
}

Without knowing exactly what presentation you want to change, it's
impossible to say exactly which rules you should use. You'll probably want
to make use of the 'inherit' keyword though.

For future reference, it's better to supply a URL to an example document.
--
Jim Dabell

Jul 20 '05 #4
*Jim Dabell* <ji********@jimdabell.com>:
jetobe wrote:
I have tried using the !important tag

Keyword -- actually "!" and "important" are separate keywords.
The !important declaration means that it should take priority over user
declarations in some cases.
Yes.
It's got nothing to do with making elements inherit their parent's styling.


Well, actually it does somehow.

foo {color: green !important}
foo bar {color: red}
foo,bar {color: orange}

<foo>Green <bar>Green</bar></foo> <bar>Orange</bar>

The selector "foo bar" has a higher specifity than "foo", but !important
declarations are only affected by specifity, if the other declaration is
!important too, thus:

foo bar {color: blue !important}
foo {color: green !important}
foo bar {color: red}
foo,bar {color: orange}

<foo>Green <bar>Blue</bar></foo> <bar>Orange</bar>

+--------------------<REC-CSS2 - 6.4.1 Cascading order>--------------------+
| 2. The primary sort of the declarations is by weight and origin: |
| (...) "!important" declaration override normal declarations. (...) |
| 3. The secondary sort is by specificity of selector: (...) |
| 4. Finally, sort by order specified: (...) latter specified wins. |
+--------------------------------------------------------------------------+

I'm certain not all browsers get this right. Hopefully I did.

P.S.: Yes, 'orange' is not a valid color keyword in CSS2.

--
Useless Fact #12:
The national anthem of Greece has 158 verses. No one in Greece has memorized all
158 verses.
Jul 20 '05 #5
In article <bn***********@ariadne.rz.tu-clausthal.de> in
comp.infosystems.www.authoring.stylesheets, Christoph Paeper
<cr***********@gmx.net> wrote:
Useless Fact #12:
The national anthem of Greece has 158 verses. No one in Greece has memorized all
158 verses.


No one?

In the words of W. Edwards Deming, "How do you know this? On what
basis do you know this?"

(And do you really mean verses or stanzas?)

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #6
Jukka K. Korpela wrote:
Brian wrote:
jetobe wrote:
<h3><a href="www.legislation.qld.gov.au">Queensland Acts</a></h3>

The problem is that the <a> tag is taking precedence and overriding
the <h3> tags that they want the text to resemble.
the way, the href value is almost surely wrong.


I didn't notice that. I must have been tired when I answered the post.
the following css should give you better results:

h3 a { color: blue; }


Some some strange value of "better". Now if the user's browser has settings
that use green color for unvisited links and gray color for visited links,
the user will be mislead into thinking that it's not a link at all.


I stuck that in as an example, and what a bad example it was. I
should have put font-size: 100% instead of a color declaration without
a background color declared. Apologies.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #7
Thanks everyone for your help, sorry I couldn't post an example URL as
it's intranet. (And yes the URL in the example was fake, and wrong,
my mistake, as real link was internal).

To clarify, there are some headings that they want to be linked, as
well as lower level items.

eg.

Queensland Acts (links to general page containing links to all Acts)
- Act #1
- Act#14

etc (link to acts with specific relevance).
Headings are maroon & larger, links are blue and underlined. Linked
headings are intended be Maroon & underlined & larger & there are
different shades for visited etc.

I will try the h3 a {..} suggestion.

Thanks.


Jim Dabell <ji********@jimdabell.com> wrote in message news:<do********************@giganews.com>...
jetobe wrote:
I am trying to debug someone's site which has

<h3><a href="www.legislation.qld.gov.au">Queensland Acts</a></h3>

The problem is that the <a> tag is taking precedence and overriding
the <h3> tags that they want the text to resemble.


You mean there are styles applied to <a> elements that you don't want to
apply to <a> elements within <h3> elements?

Also because it's a content management server, it's all been done through
a user authoring interface that automatically nests the tags in this
order. Messy!!


No, /valid/. <a> elements cannot contain <h3> elements, if you were
thinking about changing the documents in that way.

I have tried using the !important tag in external CSS to give the
heading tags precedence over the <a> but it isn't working.


It shouldn't. The !important declaration means that it should take priority
over user declarations in some cases. It's got nothing to do with making
elements inherit their parent's styling.

Is there any way I can force


You can't force anything. You can only suggest.

the <H3> to override the <a> when they are ordered like this?


Simply construct an appropriate selector and style matching elements
appropriately:

h3 a {
/* Your styles here */
}

Without knowing exactly what presentation you want to change, it's
impossible to say exactly which rules you should use. You'll probably want
to make use of the 'inherit' keyword though.

For future reference, it's better to supply a URL to an example document.

Jul 20 '05 #8
*Stan Brown* <th************@fastmail.fm>:
comp.infosystems.www.authoring.stylesheets, Christoph Paeper
The national anthem of Greece has 158 verses. No one in Greece has memorized
all 158 verses.


In the words of W. Edwards Deming, "How do you know this? On what
basis do you know this?"


As with most signatures around, this is a shameless unverified rip-off from
someone somewhere somewhen I don't remember.
F'up2 poster

--
A bus station is where a bus stops,
a train station is where a train stops,
on my desk I have a work station...
Jul 20 '05 #9
Tim
On 28 Oct 2003 18:39:52 -0800,
ja********@dpi.qld.gov.au (jetobe) wrote:
I am trying to debug someone's site which has

<h3><a href="www.legislation.qld.gov.au">Queensland Acts</a></h3>
Which is the proper way to do it.
The problem is that the <a> tag is taking precedence and overriding
the <h3> tags that they want the text to resemble.
What are you hoping that the H3 *ELEMENT* is going to do? Having the
contents *also* a link means that the text is going to be highlighted as
a link (possibly coloured and underlined), as well as whatever H3
renders as (probably a bigger and bolder font).

Or another way to put that, is what don't you want the A element inside
a H3 element to do?

(H3 meaning a sub-sub-heading, just in case you're trying to do
something oddball with H3 elements, too.)
It's problematic because it's a huge site (around 500 pages), it's in
MS Content Management Server 2002 (which means I can't access more
than one page at any one time - no global find/replace!, and templates
mean I have no access to the <head>) and this is occurring throughout
with all H1, H2, H3 tags that have an <a> within. Also because it's a
content management server, it's all been done through a user authoring
interface that automatically nests the tags in this order. Messy!!
Actually it's doing it correctly, which is a nice change.
I have tried using the !important tag in external CSS to give the
heading tags precedence over the <a> but it isn't working. Is there
any way I can force the <H3> to override the <a> when they are ordered
like this?


All I can guess is that you want the content of H3 elements to look the
same whether there's a link, or not, inside them (and that's only a
guess). If that's right, then you want to play with styling the A
elements that are children of H elements, to modify how those particular
A elements will look (without affecting the rest, nor necessitating you
having to make special classes of elements in the HTML). Leave your
styling for your H3 elements alone.

Something like:

h3 > a {text-decoration: none;}

See: <http://www.w3.org/TR/REC-CSS2/selector.html#q1>
<http://www.w3.org/TR/CSS2/text.html#q3>

--
My "from" address is totally fake. (Hint: If I wanted e-mails from
complete strangers, I'd have put a real one, there.) Reply to usenet
postings in the same place as you read the message you're replying to.
Jul 20 '05 #10

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

Similar topics

17
by: Scott | last post by:
Hi, Can I ask some advice in regards database solutions and content management solutions.? Do you have a philosophy on what is the best for databases - ASP, JSP, Cold fusion, PHP, etc. My...
5
by: Mudge | last post by:
Hi, I am relatively new to PHP, but I don't care about that. I want to build a database driven Web site that is really a content management system that allows visitors to register and log in and...
12
by: jonathan.beckett | last post by:
Hi All, For the past few months I have been working on an open source Apache/PHP/MySQL content management system - and have recently made it available for download. It's still very much a...
0
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress...
4
by: | last post by:
Do any of the ASP programmers on this form utitlize ASP Content Management Systems for any of their customer (or own sites). If so, I would be grateful for any feedback and thoughts on using CMS in...
1
by: Epetruk | last post by:
Hello all, I'm sorry for the long post, but I think it's better if I'm as detailed as I can be so that I don't make a mistake in my choice and so that there's a clear understanding of to what...
3
by: Tom | last post by:
Hi, I am currently looking for a Content Management System for one of my project in ASP.NET. Here are the requirements: * web based content management * ability to enter content/fragment...
7
by: Water Cooler v2 | last post by:
I know what it is, and yet the knowledge of what a CMS is, is so vague that I find myself asking this question every now and then. I've googled and read the resources too. However, the knowledge is...
3
by: bikefreedom | last post by:
I am looking for programmers to develop a content management system which can be attached to websites so that the customers can change their website without any problems. Email me for more details...
0
by: vayalumkan | last post by:
Hi Sir, I want some technical help on how to develop(Implement) a Content Management System using ASP.NET and C#? Can any body help me to develop a CMS (Content Management System) ? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.