Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7308443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:33:29+00:00 2026-05-28T23:33:29+00:00

w3 html validator will tell me that this is wrong: <a href=http://www.bla.com> <div>something</div> <ul>

  • 0

w3 html validator will tell me that this is wrong:

<a href="http://www.bla.com>
   <div>something</div>
   <ul>
       <li>first</li>
       <li>second</li>
   </ul>
</a>

in order to get a validated as HTML 4 strict (or just for writing things correctly)

What is the better way to write it:

  1. no div’s and ul’s – just span’s with classes that I need to design:

    <a href="http://www.bla.com>

      <span class="div">something</span>
       <span class="ul">
           <span class="li">first</span>
           <span class="li">second</span>
       </span>
    </a>
    
  2. without <a>

<div id="actAsLink" onclick="javascript:window.open('http://www.bla.com')>

<div>something</div>

<ul>

   <li>first</li>
   <li>second</li>

</ul>

</div>

=========================

sorry that the code doesn’t look at its best – I had troubles handling the “code sampler” on this website.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T23:33:30+00:00Added an answer on May 28, 2026 at 11:33 pm

    I vote for option 1: Anchor + descriptive class names:

    • The link will work, even when JavaScript or pop-ups are disabled. (this is the most important feature to me.)
    • The class attributes describe their role, as a substitute for the <ul>, <li> elements. These elements can be styled using CSS.

    Your structure looks a bit odd though: Why do you want to nest a list in an anchor?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using curl like this: curl -s -F uploaded_file=@/path_to_file;type=text/html -F output=soap12 http://localhost/w3c-markup-validator/check >text.xml
In the examples here: http://api.jquery.com/append/ they show straight HTML being used as an argument:
The complete warning is Validation (): Element 'html' occurs too few times This is
I have created a html page in php and upon submission i validates that
It's widely considered that the best reason to validate one's HTML is to ensure
I need to create a custom TextBox control that allows user input HTML tags.
I'm looking for a tool that will give me the proper generated source including
I am writing a custom validation set that will display all missing elements on
I am not sure where I'm going wrong. The idea is that before the
On a fansite im doing http://yamikowebs.com/ee/ I have a few forms (2 atm). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.