• Resolved sivn

    (@sivn)


    Hello, complete newbie here. Sorry! :/

    So, I made a front-page.php file and set front page to static in the dashboard.

    I have created a simple theme using a tutorial and am now adding divs in the css to be displayed on the front page. These divs do not appear to show up, but when I place an image inside the div the image appears.

    Is there a code I need to add somewhere to make the divs appear? Plus, does it make sense that the image appears but not the div with a set width, height and background colour?

    Thanks for your help…

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    We need to see the issue to help with this.

    Thread Starter sivn

    (@sivn)

    /* style.css */
    
    #wrapper{
        margin: 0 auto;
        width: 960px;
        width: 960px;
        text-align: left;
        background: #fff;
    }
    
    .sidebar{
        float: right;
        width: 235px;
        margin: 0 0 0 0px;
        font-size: 14px;
        list-style: none;
        background: #A8D0DF;
        padding: 20px;
    
    /* This is the new div I am trying to add */
    
    #mainpic{
        float: left;
        width: 665px;
        height: 900px;
        background: #A8D0DF;
        padding: 0 20px 0 20px;
    
    /* this is from the front-page.php */
    <?php get_header(); ?>
    
    	<div class="mainpic">
    	<img src="http://localhost/wp-content/uploads/2013/08/mainpic-marie.jpg" width=665 height:=386>
    	</div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Please provide a link to the webpage with the issue.

    Thread Starter sivn

    (@sivn)

    /* from style.css */
    
    #wrapper{
        margin: 0 auto;
        width: 960px;
        width: 960px;
    	text-align: left;
        background: #fff;
    }
    
    #mainpic{
        float: left;
        width: 665px;
        height: 900px;
        background: #A8D0DF;
        padding: 0 20px 0 20px;
    }
    
    .sidebar{
        float: right;
        width: 235px;
        margin: 0 0 0 0px;
        font-size: 14px;
        list-style: none;
        background: #A8D0DF;
        padding: 20px;
    }
    
    /* from front-page.php */
    
    <?php get_header(); ?>
    
    	<div class="mainpic">
    	<img src="http://localhost/wp-content/uploads/2013/08/mainpic-marie.jpg" width=665 height:=386>
    	</div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    Thread Starter sivn

    (@sivn)

    Oh, I am running it locally only with MAMP…

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    How familiar are you with CSS?

    Thread Starter sivn

    (@sivn)

    I just know the very basics, and look up each thing I am doing online.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Are you familiar with the concept of how CSS targets HTML elements through classes (.) and ids (#) ?

    Thread Starter sivn

    (@sivn)

    Oh!! Bingo. I should have put id in stead of class!! You are a good teacher. Thank you very much. Steep learning curve here… 😉

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Divs on front page’ is closed to new replies.