The website that I am putting together allows users to log in. Somewhere on the page, it will either say, "Log in: {Username} {Password}" or "You are logged in as {name}. Log out". What is the most appropriate way to section it off in HTML5? div, section, aside, or something else?

4 answers

sbuk 30
0
points

The <div> tag is semantically null. Obviously that doesn't mean that <div>'s are redundant, but semantically, the login is part of a <section> of the page/app and the mark up could be <section id=login></section>.

Answered about 6 years ago by sbuk
0
points

Im not sure if theres anything special in HTML5 for this. check here: http://dev.w3.org/html5/spec/

I would probably just do something like this:

<div id='login'>
</div>

if not logged in, then display a login form, if logged in, display login information. use labels in the form (:

Answered over 6 years ago by Menno Geelen
0
points

if you wanted to use one of the special HTML5 elements then use section, but I'm not sure it has enough weight to justify that, I'd just wrap it in a div.

Answered over 6 years ago by Tony Crockford
0
points

as far as I know <div id="loginform"></div> is the only solution, go on with that.

Answered over 6 years ago by Muhammad Yoosuf