• In archive pages I have this code:

    <?
    
    get_header();
    ?>
    <BR></BR>
    <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
    
    	<main id="primary" class="site-main">
    
    

    Instead of the broken rule, that works also on mobiles (and an extra space is too much), I thought I could create a div space to contain “the archive title”, so that I could give a little of padding top to the title only to bigger screens, instead of the broken rule. Other wise I should code something to make work the broken rule only on big screens

    • This topic was modified 1 year, 8 months ago by sacconi.
Viewing 1 replies (of 1 total)
  • Your page title already has enough markup to style it with CSS, there’s no need for the <br> tag or enclosing it in a div container.

    You can add your padding with the following CSS selector:

    h1.page-title {
        padding-top: 10px
    }

    If this doesn’t work, then some other CSS on the page is overriding it… and you’ll have to provide a live URL for us to check and give you the correct CSS code.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding a DIV’ is closed to new replies.