Appropriate application of section, article, and heading conventions

Recently, I created a complex liquid slider that serves as the header for my website. This slider contains various important content elements like heading tags (h-tags), paragraph tags (p-tags), and images. I found myself pondering whether each individual slide within the slider could be considered an article on its own. Unsure of the correct answer, I turned to seek assistance from others. My main concern is whether my code is properly nested and adheres to the use of Semantic Elements.

 <header id="masthead" class="site-header" role="banner">
    <div id="main-slider" class="liquid-slider">    
            <article id="slider-1" class="liquid-slide-wrapper" style="background: url(images/back-99.jpg) 50% 50% /cover; repeat:no-repeat; min-height:450px;">
                <section class="section-text-left">
                    <header>
                        <h1 class="title" style=" color:#f7740a; display:none;">Do You Need a Professional, Affordable Website?</h2>
                        <h2 style=" color:#fff; display:none;">Want to Customize Your Website Yourself?</h3>
                    </header>
                    <p style="display:none; color:#fff;">Our unique websites come with a Wordpress CMS system which allows you to make changes easily! Take control and contact us for more information today!
                    </p>
                    <p style="display:none;"><button type="button" class="btn btn-primary btn-lg">Email Us</button>&nbsp;<button type="button" class="btn btn-transparent btn-lg">0494 / 77 22 61</button></p>
                </section>
                <section class="section-img-right clearfix">
                    <img class="slider-img-right fadeInRight animated" style="display:none; width:100%; max-width:692px; height:auto;" src="images/imac.png" />
                    <img class="slider-img-right fadeIn animated-slow" style="display:none; width:100%; max-width:692px; height:auto;" src="images/straf-webdesign.png" />
                    <img class="slider-img-right fadeIn animated-slow" style="display:none; width:100%; max-width:692px; height:auto;" src="images/responsive-webdesign.png" />
                </section>      
            </article>
            <article id="slider-2" style="background: url(images/background-7.png) 50% 50% /cover; repeat:no-repeat; min-height:450px;">
                <section class="section-text-left">
                    <header>
                        <h1 class="title" style=" color:#f7740a; display:none;">JustOnWeb Becomes Kudu Concepts!</h2>
                        <h2 style="display:none; color:#000;">A Fresh Start with a More Professional Approach!</h3>
                    <header>
                    <p style="display:none; color:#fff;">Building a website involves more than just design. With Kudu Concepts, we take it further by creating a complete philosophy for your website and combining it with our expertise in Online Marketing!
                    </p>
                </section>
            </article>
          </div>
</header>

Answer №1

As outlined in the W3Schools documentation on HTML5 semantic elements found here: http://www.w3schools.com/html/html5_semantic_elements.asp

The usage of <section> containing <article> is recommended, however it is advised against nesting <section> within <article> and within <header>. According to the W3C, a section represents "a thematic grouping of content, typically with a heading."

<header> should be positioned at the top of its parent element, such as the body (the header) and above sections, articles, or any other div elements.

In your code: <h1> tags should be closed with </h1> and not h2, likewise for <h2>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Setting the Minimum Width of Floating Columns in HTML and CSS

Can anyone provide some assistance? I am currently using a design that I want to modify so that the columns do not compress or shrink below a certain size. I have attempted to use "min-width" without success. Any help would be greatly appreciated. Thank y ...

Issue with Table Content Being Truncated After Conversion from HTML to MS Word 2003

I am experiencing an issue where the table content is being cut off on the right side of the page when converting from an HTML page into MS Word 2003. Below is a sample HTML code (where placeholder $CLOB_DATA will be replaced by large CLOB data): <html ...

What is the best way to implement a 'box-shadow-right' that stops at the border?

How can I achieve a seamless shadow effect at the border-right of a small div that matches the shadow of a larger div, without cutting off at the border-bottom of the small div or the border-top of the large div? I am unable to use Z-index due to the compl ...

Why is Validators.pattern not functioning in production when it works perfectly in my local development environment for Angular?

Why is Validators.pattern not working in the production environment but functioning fine in my local development setup? I implemented Validators.pattern and '*ngIf="email.errors.pattern"' for email validation on an existing form. Every ...

Fade in and out HTML divs using jQuery with customizable timing intervals

I'm attempting to alter an existing solution here by incorporating a total of 7 divs that have fading in and out effects, all within the same space on the page. The sequence should loop back to the initial div after reaching the end. In addition, I r ...

Reset the child JSP page to its original appearance

Displayed below is a JSP page: <div id="tabs-7" style="width: 100%;"> <form:form id="deviceForm" name="" modelAttribute="" enctype="multipart/form-data"> <div class="inputWidgetContainer"> <div class="inputWidget"> <table> ...

In Chrome, there is a conflict between the screen width when using `position: absolute` and `position: fixed` if there is vertical

I'm in the process of developing a website with a video banner set to fixed positioning in the background, and a div that has absolute positioning covering part of the video on the bottom half. However, I've encountered an issue - when I add this ...

Troubleshooting CSS issues for Compatibility View on Internet Explorer

I have been using CSS to create a dropdown navigation menu without the use of JavaScript. It seems to be working perfectly in most browsers, however, I am encountering some issues with certain versions of Internet Explorer. I've spent hours trying var ...

What is the correct way to write this unusual '<a>' tag markup using Pug language?

For a list of additional features and functionalities, click here. I'm attempting to write the above in Pug format. I've tried translating it directly from HTML, but it's not displaying correctly. Below is my attempt: li For more features ...

I'm having trouble retrieving and rendering data in HTML using AngularJS and Spring

After fetching the data, I am unable to see it in the HTML code. The web browser console displays the JSON data but it is not visible in the HTML code. Here is my AngularJS code: $scope.refresh = function(){ fetchData(); }; $scope.fetchData = functio ...

Trouble with Displaying Table Outside of Div in Internet Explorer

As a UI developer, I encountered an issue where the table inside two divs is not displaying correctly in IE8. It works seamlessly in Firefox, but IE is causing me headache. If anyone has any suggestions or advice on how to fix this, please help me out. Yo ...

What could be the reason for bootstrap failing to recognize and apply my variables?

Whenever I set the text color to green using this code: @textColor: green; It works perfectly and changes the text color, but when I try to modify grid column width and gutter width with this code: @gridColumnWidth: 10px; @gridGutterWidth: 0px; @flu ...

At 400 pixels screen size, the buttons in the appBar component are spilling out

In my appBar component, I have three buttons that appear fine on large screens. However, when the screen size reaches 400px, they start stretching out of the appBar. Here is how they look on large screens: https://i.sstatic.net/l3nJM.png And this is how ...

When using the `display: table-cell` property on a div element, it does not automatically respect

How can I restrict the width of columns by defining a width attribute on the div.dcolumn DOM element to preserve the layout with overflowing cells? I want the content of any overflowing cell (like the 9px column) to be hidden while maintaining the specifie ...

I would like to showcase the image with specific dimensions in CakePHP

Currently working on a CakePHP application where I need to upload an image. However, for some sections of my app, I need to display the image at a specific height and width without losing image quality. Any suggestions on how to achieve this? ...

What methods can be utilized to implement automatic location detection on a website using HTML5?

For a web project I'm developing, there's a specific requirement where a button labeled "auto detect" needs to be included. When this button is clicked, the visitor should receive a popup displaying their location near a textbox. I have successfu ...

Step-by-step guide on transferring an HTML5 sqlite result set to a server using AJAX

Imagine I have a scenario where I receive a result set as shown below: db.transaction( function(transaction) { transaction.executeSql( 'SELECT col1, col2, col3 FROM table;', [],function(transaction, result){ //need to find a ...

The stylesheet's URL reference to the image is not functioning properly

I'm attempting to showcase images inside a table cell using CSS. Here's what I currently have: HTML: <td class="activity-status status_not_started">Not Started</td> CSS: td.activity-status { font: 0/0 a !important; color: transpar ...

Reposition picture "overlays" additional HTML components

I am struggling with rotating an image by clicking on a button as the image overlaps the buttons. Can anyone provide guidance on how to achieve this without overlapping? For reference, here is my code and an example: here (http://jsfiddle.net/jj03b17n/5/) ...

Adjust the menu scrollbar position to the right or limit scrolling to within the menu area

$(function() { "use strict"; $(".navbar-toggler").on("click", function() { $(".navbar-toggler").toggleClass("collapsed"); $(".offcanvas-collapse").toggleClass("open"); let menuposition = $("#toggler").offset().left + $("#toggler").width() + ...