467,077 Members | 967 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

Linking a style to a specific anchor tag

Greetings, all...

I've got a (for me) stumper...

I need to attach what will amount to a float:right; sidebar to a
specific location on a page. Not an absolute position, mind you, but
to a specific anchor tag. The entire page is dynamic being generated
from a database so I will have no way of telling where on the page the
desired anchor will be.

Oh, and to complicate things even more, it will have to "break out" of
the parent container div (hence the float idea) and align to the
absolute right of the viewport.

As I said, the anchor will always be reliable as <a name="opinions">
but I don't know how to attach the sidebar to it.

Of course, it is late and I may be looking at this completely
ass-backwards, so if you have a better way of doing this, I would
appreciate your suggestions!

Thanks in advance,
Ric Castagna
Jul 20 '05 #1
  • viewed: 4792
Share:
5 Replies
Ric Castagna
<news:45**************************@posting.google. com>:
I need to attach what will amount to a float:right; sidebar to
a specific location on a page. Not an absolute position, mind
you, but to a specific anchor tag. The entire page is dynamic
being generated from a database so I will have no way of
telling where on the page the desired anchor will be.


Can't you attach a class to that anchor and style the class
apropriately?

--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
Jul 20 '05 #2
Rob,

Thanks for your feedback. Great idea, that, unfortunately I already
tried. The problem with applying the class to the <a
name="opinions"></a> tag is that I can't put valid HTML within the <a>
tag. It won't validate, but more importantly, it just doesn't render
properly.

Again, I appreciate the help, and I hope that there is an answer out
there somewhere!

Ric
Can't you attach a class to that anchor and style the class
apropriately?

Jul 20 '05 #3
Rob,

Thanks for your feedback. Great idea, that, unfortunately I already
tried. The problem with applying the class to the <a
name="opinions"></a> tag is that I can't put valid HTML within the <a>
tag. It won't validate, but more importantly, it just doesn't render
properly.

Again, I appreciate the help, and I hope that there is an answer out
there somewhere!

Ric
Can't you attach a class to that anchor and style the class
apropriately?

Jul 20 '05 #4
In article <45**************************@posting.google.com >,
ri**********@hotmail.com (Ric Castagna) wrote:
Rob,

Thanks for your feedback. Great idea, that, unfortunately I already
tried. The problem with applying the class to the <a
name="opinions"></a> tag is that I can't put valid HTML within the <a>
tag. It won't validate, but more importantly, it just doesn't render
properly.

Again, I appreciate the help, and I hope that there is an answer out
there somewhere!

Ric
Can't you attach a class to that anchor and style the class
apropriately?


Including a class or id to an <a> tag validates under HTML 4.01
transitional, but even so, I don't think this solves your problem.
Floating the anchor doesn't move the sidebar. It seems to me that you
need to enclose the sidebar in a div, and id or class that div to float
right, or wherever.
Jul 20 '05 #5
In article <45**************************@posting.google.com >,
ri**********@hotmail.com (Ric Castagna) wrote:
Rob,

Thanks for your feedback. Great idea, that, unfortunately I already
tried. The problem with applying the class to the <a
name="opinions"></a> tag is that I can't put valid HTML within the <a>
tag. It won't validate, but more importantly, it just doesn't render
properly.

Again, I appreciate the help, and I hope that there is an answer out
there somewhere!

Ric
Can't you attach a class to that anchor and style the class
apropriately?


Including a class or id to an <a> tag validates under HTML 4.01
transitional, but even so, I don't think this solves your problem.
Floating the anchor doesn't move the sidebar. It seems to me that you
need to enclose the sidebar in a div, and id or class that div to float
right, or wherever.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by nam | last post: by
1 post views Thread by Ang Talunin | last post: by
2 posts views Thread by bill yeager | last post: by
15 posts views Thread by phillip.s.powell@gmail.com | last post: by
6 posts views Thread by sowencheung@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.