Reply
Old 07-30-2010, 09:12 AM xhtml validator
NickH's Avatar
Skilled Talker

Posts: 85
Trades: 0
yo yo

how do i go about making a link open up in target="_blank" in xhtml strict

i would use transitional but it's for an assignment
__________________
Fourth Chamber

My Portfolio
NickH is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-30-2010, 09:23 AM Re: xhtml validator
chrishirst's Avatar
Super Moderator

Posts: 32,316
Location: Blackpool. UK
Trades: 0
1/ Use a frameset DTD it's perfectly valid there.

2/ Remove the href attribute of all links and use window.open() in the onclick event.

3/ Use javascript to add the target attribute to all anchor elements, it will still be invalid but the validator will not be able to tell.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Code Samples | Crowded Nightclub? | Random Ramblings
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-30-2010, 09:25 AM Re: xhtml validator
chrishirst's Avatar
Super Moderator

Posts: 32,316
Location: Blackpool. UK
Trades: 0
OR of course you could actually stick to strict XHTML and not try to wangle a way around it because the rules don't suit you.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Code Samples | Crowded Nightclub? | Random Ramblings
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-30-2010, 09:26 AM Re: xhtml validator
chrishirst's Avatar
Super Moderator

Posts: 32,316
Location: Blackpool. UK
Trades: 0
OH! I missed a fourth option.


4/ Write your own strict DTD where the target attribute is valid.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Code Samples | Crowded Nightclub? | Random Ramblings
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-30-2010, 09:43 AM Re: xhtml validator
Siemen's Avatar
Average Talker

Posts: 17
Trades: 0
Try <a href="" onclick="target='new'"> </a>
Siemen is offline
Reply With Quote
View Public Profile
 
Old 07-30-2010, 10:54 AM Re: xhtml validator
NickH's Avatar
Skilled Talker

Posts: 85
Trades: 0
Quote:
Originally Posted by chrishirst View Post
OR of course you could actually stick to strict XHTML and not try to wangle a way around it because the rules don't suit you.
yeah i know... its part of the distinction criteria for a TAFE assignment
"
"

"Convert all pages of the site to XHTML 1.0 Strict, validated using the W3C validator. The requirement that some pages open in a new window or tab can be omitted from the site but all other formatting should display identically to the Transitional version. (3 points)"

although reading that does say that i can miss out the new window attribute
__________________
Fourth Chamber

My Portfolio
NickH is offline
Reply With Quote
View Public Profile
 
Old 08-01-2010, 10:57 AM Re: xhtml validator
NickH's Avatar
Skilled Talker

Posts: 85
Trades: 0
alright ive got another one for anyone to help with

heres the code
Code:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!--- Created by Nick Hayden (29/07/2010) -->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Coffee Menu</title>
        <style type="text/css">
            body 
        {
            background-color:#cb7f2e;
            font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
        }
            p
            {
                font-size:10pt;
            }
        
        a
        {
            color:#363c33;
            
        }
        a:visited
            {
                color:#274828;
                
            }
        a img
            {
                border:none;
            }
            
        </style>
    </head>
    <body>
        

    <table border="0">

    <tr>

    <td colspan="2"> <a href="../html/homepage.html"><img src="../images/coffeebeans.jpg" alt="Coffee Shop Header" 
                     height="100" style="margin-left:30px;" /><img src="../images/coffeebeans.jpg" alt="Little Bean Coffee Shop Header" 
                     height="100" /><img src="../images/coffeebeans.jpg" alt="Little Bean Coffee Shop Header" 
                     height="100" /><img src="../images/coffeebeans.jpg" alt="Little Bean Coffee Shop Header" 
                     height="100" /><img src="../images/coffeebeans.jpg" alt="Little Bean Coffee Shop Header" 
                     height="100" /><img src="../images/coffeebeans.jpg" alt="Little Bean Coffee Shop Header" 
                     height="100" /><img src="../images/coffeebeans.jpg" alt="Little Bean Coffee Shop Header" 
                     height="100" /><img src="../images/coffeebeans.jpg" alt="Little Bean Coffee Shop Header" 
                     height="100" /></a> </td>

    </tr>

    <tr>

    <td valign="top" style="width:150px;"><ul style="list-style-type:none; align:top; text-align:center; position:absolute; top:215px; left:0px">
                                                <li>
                            <img src="../images/coffee_bean_arrow.jpg" alt="Coffeebean Arrow" width="50px" />
                            <br />
                            <a href="../html/coffee.html">
                                            
                                                Coffee
                                            </a>
                                                </li>
                                                
                                                <li>
                            <img src="../images/coffee_bean_arrow.jpg" alt="Coffeebean Arrow" width="50" />
                            <br />
                            <a href="../html/menu.html">
                                        
                                                Menu
                                                </a>
                                                </li>
                                                
                                                <li>
                            <img src="../images/coffee_bean_arrow.jpg" alt="Coffeebean Arrow" width="50" />
                                            <br />
                                                <a href="../html/contact.html">Contact Us</a>
                                            
                                                    
                                                </li>
    </ul> </td>
    
    <td valign="top"><h1 style="text-align:center;">Coffee Menu</h1><hr />
        <table summary="Coffee Menu and Pricing" border="1" style="width:100%;">
        <tr>    
            <td>
                Coffee
            </td>
            <td>
                Price
            </td>
        </tr>
        <tr>
            <td>
                Espresso 
            </td>
            <td>
                $2.80
            </td>
            <tr>
            <td>
                Macchiato
            </td>
            <td>
                $2.90
            </td>
            </tr>
        <tr>
            <td>
                Cappucino
            </td>
            <td>
                $3.10
            </td>
        </tr>
        <tr>
            <td>
                Long Black
            </td>
            <td>
                $2.90
            </td>
        </tr>
        <tr>
            <td>
                Short Black
            </td>
            <td>
                $2.80
            </td>
        </tr>
        <tr>
            <td>
                Latte
            </td>
            <td>
                $3.10
            </td>
        </tr>
        <tr>
            <td>
                Flat White
            </td>
            <td>
                $3.10
            </td>
        </tr>
        <tr>
            <td>
                Hot Chocolate
            </td>
            <td>
                $3.50
            </td>
        </tr>
    </table> </div> </td>

    </tr>

    </table>
    <div style="text-align:center;">
    <p><a href="../html/contact.html">Contact Us</a> | <a href="../html/copyright.html">Copyright</a> | <a href="../html/privacy.html">Privacy</a> | <a href="mailto:nickhayden1992@gmail.com">Web Administrator</a></p>
        
    </div>

    </body>
</html>
and heres the errors

Code:
 
Line 101,         Column 7:     document type does not allow element "tr" here     			<tr>                     
                  The element named above was found in a context where it is not allowed.       This could mean that you have incorrectly nested elements -- such as a       "style" element in the "body" section instead of inside "head" -- or       two elements that overlap (which is not allowed).     
            One common cause for this error is the use of XHTML syntax in HTML       documents. Due to HTML's rules of implicitly closed elements, this error       can create cascading effects. For instance, using XHTML's "self-closing"       tags for "meta" and "link" in the "head" section of a HTML document may       cause the parser to infer the end of the "head" section and the       beginning of the "body" section (where "link" and "meta" are not       allowed; hence the reported error).

theres 9 errors total that are the same all about the <tr> so yeah if anyone could help that would be awesome
__________________
Fourth Chamber

My Portfolio
NickH is offline
Reply With Quote
View Public Profile
 
Old 08-05-2010, 07:35 AM Re: xhtml validator
Novice Talker

Posts: 7
Trades: 0
If you haven't got this fixed yet, the solution is below.

Code:
<tr>
<td>Espresso</td>
<td>$2.80</td>
Missing closing tr tag
<tr>
<td>Macchiato</td>
<td>$2.90</td>
</tr>
HullBorn is offline
Reply With Quote
View Public Profile
 
Old 08-05-2010, 08:41 AM Re: xhtml validator
LadynRed's Avatar
Super Moderator

Posts: 9,498
Location: Tennessee
Trades: 0
Quote:
Ensure the external website opens in a new window.
That is so old-school and really bad for accessibility. I can't believe they still teach this way.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-06-2010, 03:48 AM Re: xhtml validator
Banned

Posts: 1
Name: ooscar
Trades: 0
Xhtml Validator. Convert multiple RTF and Text to HTML with CSS, XHTML or plain HTML 3.2. JXHTMLEDIT is a cross-platform WYSIWYG HTML/XHTML content authoring tool.
___________________
Nursery Admissions Guide
ooscar1237 is offline
Reply With Quote
View Public Profile
 
Old 08-06-2010, 06:50 AM Re: xhtml validator
NickH's Avatar
Skilled Talker

Posts: 85
Trades: 0
Quote:
Originally Posted by LadynRed View Post
That is so old-school and really bad for accessibility. I can't believe they still teach this way.
yeah i know, they've got us to code in tables and all that jazz
but as the teachers keep saying its better to learn about everything and then learn what not to do
__________________
Fourth Chamber

My Portfolio
NickH is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to xhtml validator
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15754 seconds with 13 queries