target attribute via CSS?

Discussion in 'HTML' started by Marcus Stollsteimer, Jan 23, 2006.

  1. Hi group,

    is there a css-version of the target attribute, so that
    I can express

    <a href="gnat.html" target="somthing">Link</a>

    by

    <style type="text/css">
    a { target:something; }
    </style>

    and

    <a href="gnat.html">Link</a> ?


    Best regards,
    Marcus

    --
    It is awfully hard work doing nothing. -- Oscar Wilde
    Marcus Stollsteimer, Jan 23, 2006
    #1
    1. Advertising

  2. Marcus Stollsteimer wrote:
    > Hi group,
    >
    > is there a css-version of the target attribute, so that
    > I can express
    >
    > <a href="gnat.html" target="somthing">Link</a>
    >
    > by
    >
    > <style type="text/css">
    > a { target:something; }
    > </style>
    >
    > and
    >
    > <a href="gnat.html">Link</a> ?


    No.

    Firstly "target" is an HTML *attribute* not a CSS style *property* and
    cannot set or create the attribute. Now you can style all A elements
    that have target attributes with the selector:

    A[target] { ... }

    or only A elements that target a specific frame:

    A[target="left_pane"] { ... }

    Secondly, the "target" attribute is supposed to be reserved for frame
    applications and not to create new browser windows <duck and cover>...

    Maybe a little elaboration on what you are trying to accomplish here we
    can better advise...

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 23, 2006
    #2
    1. Advertising

  3. Jonathan N. Little wrote:

    > Marcus Stollsteimer wrote:
    >> Hi group,
    >>
    >> is there a css-version of the target attribute, so that
    >> I can express
    >>
    >> <a href="gnat.html" target="somthing">Link</a>
    >>
    >> by
    >>
    >> <style type="text/css">
    >> a { target:something; }
    >> </style>
    >>
    >> and
    >>
    >> <a href="gnat.html">Link</a> ?

    >
    > No.
    >
    > Firstly "target" is an HTML *attribute* not a CSS style *property*
    > and cannot set or create the attribute. Now you can style all A
    > elements that have target attributes with the selector:


    Sorry, what I really meant is:

    Can I replace the HTML attribute with some CSS style property
    that has the _same effect_, like

    a { some-target-property:something; }

    Regards,
    Marcus

    --
    See, that's the thing about philosophy--
    it's not all that functional once you get out of class. -- W. Allen
    Marcus Stollsteimer, Jan 23, 2006
    #3
  4. Marcus Stollsteimer wrote:

    > is there a css-version of the target attribute


    No. (And frames and new windows are, far more often then not, harmful
    anyway).
    David Dorward, Jan 23, 2006
    #4
  5. Marcus Stollsteimer

    BootNic Guest

    > "Marcus Stollsteimer" <> wrote:
    > news:dr2sre$594$-stuttgart.de....
    >
    > Hi group,
    >
    > is there a css-version of the target attribute, so that
    > I can express
    >
    > <a href="gnat.html" target="somthing">Link</a>
    >
    > by
    >
    > <style type="text/css">
    > a { target:something; }
    > </style>
    >
    > and
    >
    > <a href="gnat.html">Link</a> ?


    http://www.htmlhelp.com/reference/html40/head/base.html

    --
    BootNic Monday, January 23, 2006 1:30 PM

    The world is very different now. For man holds in his mortal hands the power to abolish all forms of human poverty, and all forms of human life.
    *John Fitzgerald Kennedy, Inaugural Address*
    BootNic, Jan 23, 2006
    #5
  6. Marcus Stollsteimer wrote:

    > Jonathan N. Little wrote:
    >
    >
    >>Marcus Stollsteimer wrote:
    >>
    >>>Hi group,
    >>>
    >>>is there a css-version of the target attribute, so that
    >>>I can express
    >>>
    >>> <a href="gnat.html" target="somthing">Link</a>
    >>>
    >>>by
    >>>
    >>> <style type="text/css">
    >>> a { target:something; }
    >>> </style>
    >>>
    >>> and
    >>>
    >>> <a href="gnat.html">Link</a> ?

    >>
    >>No.
    >>
    >>Firstly "target" is an HTML *attribute* not a CSS style *property*
    >>and cannot set or create the attribute. Now you can style all A
    >>elements that have target attributes with the selector:

    >
    >
    > Sorry, what I really meant is:
    >
    > Can I replace the HTML attribute with some CSS style property
    > that has the _same effect_, like
    >
    > a { some-target-property:something; }
    >


    I'm sorry did you read my response? I inferred for your question that is
    what you were trying to do and I wrote:

    > No.
    >
    > Firstly "target" is an HTML *attribute* not a CSS style *property* and cannot set or create the attribute. Now you can style all A elements that have target attributes with the selector:
    >
    > A[target] { ... }
    >
    > or only A elements that target a specific frame:
    >
    > A[target="left_pane"] { ... }
    >
    > Secondly, the "target" attribute is supposed to be reserved for frame applications and not to create new browser windows <duck and cover>...




    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 23, 2006
    #6
  7. Marcus Stollsteimer

    Mark Parnell Guest

    Deciding to do something for the good of humanity, Marcus Stollsteimer
    <> spouted in alt.html:

    > Can I replace the HTML attribute with some CSS style property
    > that has the _same effect_, like


    As Jonathan said, no. It's not a styling issue, so has nothing to do
    with CSS.

    --
    Mark Parnell
    =====================================================
    Att. Google Groups users - this is your last warning:
    http://www.safalra.com/special/googlegroupsreply/
    Mark Parnell, Jan 23, 2006
    #7
  8. Marcus Stollsteimer wrote :
    > Jonathan N. Little wrote:
    >
    >> Marcus Stollsteimer wrote:
    >>> Hi group,
    >>>
    >>> is there a css-version of the target attribute, so that
    >>> I can express
    >>>
    >>> <a href="gnat.html" target="somthing">Link</a>
    >>>
    >>> by
    >>>
    >>> <style type="text/css">
    >>> a { target:something; }
    >>> </style>
    >>>
    >>> and
    >>>
    >>> <a href="gnat.html">Link</a> ?

    >> No.
    >>
    >> Firstly "target" is an HTML *attribute* not a CSS style *property*
    >> and cannot set or create the attribute. Now you can style all A
    >> elements that have target attributes with the selector:

    >
    > Sorry, what I really meant is:
    >
    > Can I replace the HTML attribute with some CSS style property
    > that has the _same effect_, like
    >
    > a { some-target-property:something; }
    >



    Maybe there is an answer to your question but right now, it's impossible
    to know what you are looking for. "Some CSS style property", "something"
    are not what all of us consider as something specific, something
    defined, something identified and something clear.

    The FAQ on "How to open a referenced resource of a link in a new tab? or
    in a specific tab?" may answer you:
    DOM:window.open
    http://developer.mozilla.org/en/docs/DOM:window.open#FAQ

    Gérard
    --
    remove blah to email me
    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Jan 24, 2006
    #8
  9. Hi,

    thanks for all your answers, especially Gérard (was my
    question really so unclear?), your link led me here:

    <http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/>

    So the answer seems to be "not at the moment",
    but in CSS3 it might be possible to have something like

    a { target-name:parent; }

    Regards,
    Marcus

    --
    Chaos in the midst of chaos isn't funny,
    but chaos in the midst of order is. -- Steve Martin
    Marcus Stollsteimer, Jan 24, 2006
    #9
  10. Gérard Talbot wrote:

    > Maybe there is an answer to your question but right now, it's
    > impossible to know what you are looking for. "Some CSS style
    > property", "something" are not what all of us consider as something
    > specific, something defined, something identified and something
    > clear.


    Hi Gérard,

    I think I know the answer now (it's not yet implemented),
    but what I meant was simply:

    html attribute -> css property
    <ul type="disc"> -> <ul style="list-style-type:disc;">
    <a target="_parent"> -> <a style="gnat;">

    what is gnat?

    thanks anyway,
    Marcus

    --
    Eternal nothingness is O.K. if you're dressed for it. -- W. Allen
    Marcus Stollsteimer, Jan 24, 2006
    #10
  11. Marcus Stollsteimer wrote:
    > Hi,
    >
    > thanks for all your answers, especially Gérard (was my
    > question really so unclear?), your link led me here:
    >
    > <http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/>
    >
    > So the answer seems to be "not at the moment",
    > but in CSS3 it might be possible to have something like
    >
    > a { target-name:parent; }
    >
    > Regards,
    > Marcus
    >


    Again No.

    Okay, let's try this a different way. CSS does *not* replace all HTML
    attributes, only the attributes with respect to style (presentation) and
    not structure and content. Now take the IMG element; the SRC, ALT,
    TITLE, are attributes that affect the content but ALIGN or BORDER are a
    presentation or styling issue and are replaced with CSS with FLOAT and
    BORDER properties. Not only HTML attributes but some HTML tags that
    where presentational are replaced with CSS, CENTER, BOLD, FONT, I, SMALL
    are examples. If you want to make something bold, then style it so. If
    your content requires identifying such emphasis, then structurally mark
    the bits with EM, STRONG or <ELEMENT class="SomethingVeryImportant"> and
    style accordingly; but whether the emphasized text is bold or red or
    italic, or whatever, is a style issue and define it in your CSS.

    Now you can build CSS sectors to style specific ELEMENTS base upon HTML
    attributes, but your cannot set or change those attributes. We will use
    your target for an example, so you're using a frameset right? 3 frames
    for this example, 'banner' on the top, 'navbar' of the left and
    'content'. With CSS sectors could color all links in on your page base
    upon the target value so that links that change the 'content' frame are
    colored blue but special links that break out of the frameset are
    colored red.

    A[target="content"] { color: blue; }
    A[target="_top"] { color: red; }

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 24, 2006
    #11
  12. Marcus Stollsteimer

    Mark Parnell Guest

    Deciding to do something for the good of humanity, Marcus Stollsteimer
    <> declared in alt.html:

    > I think I know the answer now (it's not yet implemented),


    And never will be.

    --
    Mark Parnell
    =====================================================
    Att. Google Groups users - this is your last warning:
    http://www.safalra.com/special/googlegroupsreply/
    Mark Parnell, Jan 24, 2006
    #12
  13. Jonathan N. Little wrote:

    > Again No.
    >
    > Okay, let's try this a different way. CSS does *not* replace all
    > HTML attributes, only the attributes with respect to style
    > (presentation) and not structure and content.


    I am _very_ aware of that, but sometimes it is not possible
    to decide so clearly what is "presentational" and what "structural".
    And apparently the people from W3C _did_ think about introducing
    such a property. (Or am I misinterpreting the cited working draft?)

    Anyway, I do not want to argue about this, it's not that important.

    Regards,
    Marcus

    --
    It is awfully hard work doing nothing. -- Oscar Wilde
    Marcus Stollsteimer, Jan 25, 2006
    #13
  14. Marcus Stollsteimer wrote:

    > Jonathan N. Little wrote:
    >
    >
    >>Again No.
    >>
    >>Okay, let's try this a different way. CSS does *not* replace all
    >>HTML attributes, only the attributes with respect to style
    >>(presentation) and not structure and content.

    >
    >
    > I am _very_ aware of that, but sometimes it is not possible
    > to decide so clearly what is "presentational" and what "structural".
    > And apparently the people from W3C _did_ think about introducing
    > such a property. (Or am I misinterpreting the cited working draft?)
    >
    > Anyway, I do not want to argue about this, it's not that important.
    >


    My intent in not to chastise but to educate. Since you repeat the same
    question after being answered gives the impression that you did still
    did not understand. The bold text was to emphasize the point for clarity
    not to shout. Presentational vs. structural is really not too hard to
    determine.

    Structural things: <p></p> This is a paragraph, it starts here and ends
    here. <h2></h2> This is a heading, it is a level 2 heading.
    <table></table>Define tabular data, or <ul></ul><ol></ol >or listed
    data. I think you get the point here. Just marks data as to how it
    should be treated not how it should look. Say for example <span></span>
    Marks some text to be somehow be treated differently but not what that
    should be. The style you define for the span will you that . . . the
    presentational part

    Presentational things: Right justification, left justification. Font
    style family or size. Color on background and on and on.

    No lets look at your target attribute, would it effect how your link
    looks or how it is treated? Most assuredly how it is treated because it
    directs what frame the link’s href should effect! So it is structural
    not presentational.

    The advantage of the separation is we can change how the page looks
    without having to re-code all the page just the stylesheet! The old days
    with:

    <P><FONT FACE="Arial, Helvetica" SIZE=1><CENTER> . . . on every
    paragraph on many pages of your website and then you decide you want a
    serif font that was bigger and not centered!!! Ugh!

    Basically

    HTML: Structural things defines what you data is
    CSS: Presentational defines how it should look
    JAVASCRIPT: Behavior defines events and user interaction

    HTH

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 25, 2006
    #14
  15. Jonathan N. Little wrote:

    > My intent in not to chastise but to educate. Since you repeat the
    > same question after being answered gives the impression that you did
    > still did not understand.


    Sorry that I misunderstood your first answer, and thanks for
    educating me... But did you have a look at the given link?

    Regards,
    Marcus

    --
    What is life but a series of inspired follies? -- George Bernard Shaw
    Marcus Stollsteimer, Jan 25, 2006
    #15
  16. Marcus Stollsteimer wrote:
    > Jonathan N. Little wrote:
    >
    >
    >>My intent in not to chastise but to educate. Since you repeat the
    >>same question after being answered gives the impression that you did
    >>still did not understand.

    >
    >
    > Sorry that I misunderstood your first answer, and thanks for
    > educating me... But did you have a look at the given link?
    >

    If you are referring to:
    <http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/>

    CSS3 is still in development and details are being hashed out. IMHO I
    think 'target' structural and should not be part of CSS. There is no
    browser that I know of that support the property. Until CSS3 is
    finalized and there is basic browser support I would focus on CSS2.1.



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 25, 2006
    #16
  17. Jonathan N. Little wrote:

    > CSS3 is still in development and details are being hashed out. IMHO
    > I think 'target' structural and should not be part of CSS. There is
    > no browser that I know of that support the property. Until CSS3 is
    > finalized and there is basic browser support I would focus on
    > CSS2.1.


    Of course (that's why I said "it might be possible").

    Regards,
    Marcus

    --
    Time enough to think of the future
    when you havent any future to think of. -- George Bernard Shaw
    Marcus Stollsteimer, Jan 26, 2006
    #17
  18. Marcus Stollsteimer wrote:

    > Jonathan N. Little wrote:
    >
    >
    >>CSS3 is still in development and details are being hashed out. IMHO
    >>I think 'target' structural and should not be part of CSS. There is
    >>no browser that I know of that support the property. Until CSS3 is
    >>finalized and there is basic browser support I would focus on
    >>CSS2.1.

    >
    >
    > Of course (that's why I said "it might be possible").
    >
    > Regards,
    > Marcus
    >

    Let's hope not! ;-)

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 26, 2006
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TheKeith
    Replies:
    9
    Views:
    1,148
    Leif K-Brooks
    Oct 22, 2003
  2. Simon
    Replies:
    21
    Views:
    3,846
    Lauri Raittila
    Oct 31, 2004
  3. randau
    Replies:
    30
    Views:
    1,376
    Travis Newbury
    May 20, 2005
  4. Mel
    Replies:
    2
    Views:
    485
    Neredbojias
    Aug 3, 2005
  5. mohit
    Replies:
    0
    Views:
    532
    mohit
    Jan 23, 2008
Loading...

Share This Page