mardi 22 août 2017

HTML paragraph isnt going into a straight line

I'm kinda new to programming and I cant solve this problem. The paragraphs are coming out like a stair case.

    p
   p
  p
 p
p

The p's are examples, but here is all the code I have done so far. Keep in mind I'm not the best at css(I'm still learning)

All help would be appreciated

Please show me on how I an fix this problem, and tell me where in my code is this problem occurring.

I tried google but couldn't find anything...

var house = {}
function House() {
        var msg = 'This house is painted'
        var bath;
        var bed;
        var cook; 

        var Paint = document.getElementById('paint').value;
        var square = document.getElementById('Square').value;
        var bath = document.getElementById('bath').value;
        var bed = document.getElementById('Bed').value
        var cook = document.getElementById('Cook').value;
        //Get paragraphs to store values
        var paint = document.getElementById('isPaint');
        var squareFeet = document.getElementById('sq_Feet')
        var bathRoom = document.getElementById('bathroom')
        var bedRoom = document.getElementById('BedRoom')
        var kitchen = document.getElementById('kitchen');

        if(Paint == 'Yes' || Paint == 'yes') {
                house['isPainted'] = true;
                paint.innerHTML = msg;

        }
        else if(Paint == 'No' || Paint == 'no') {
                house['isPainted'] = false;
                var msg = 'this house is not painted'
                paint.innerHTML = msg;
        } 
        else if(Paint == '') {
                house['isPainted'] = undefined;
                var msg = 'no details given';
                paint.innerHTML = msg;
        } 
        if(square != '' ) {
                var squareFeetMsg = 'the house is';
                squareFeet.innerHTML = squareFeetMsg + ' ' + document.getElementById('Square').value + ' square feet';
                house['squareFeet'] = document.getElementById('Square').value
        }else {
                var squareFeetMsg = 'No Details Given';
                squareFeet.innerHTML = squareFeetMsg;
        }
}
body {
        width: auto;
        height: auto;
}
#houseDtails{
        width: 350px;;
}
#container {
        width: auto;
        height: auto;
}
.houseDetails {
        height: 0px;
        float: right;
}
<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <title>House App</title>
        <link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div id="conatainer">
        <div id="houseDtails">
                        <label for="paint">Is this house painted: </label><br>
                        <input type="text" id="paint" class="Detail" /><br>

                        <label for="Square">How many SQ feet does this have? :</label>
                        <input type="text" id="Square"><br>

                        <label for="bath">How many bathrooms does your house have</label>
                        <input type="text" id="bath"><br>

                        <label for="Bed">How many bedrooms dos your house have</label>
                        <input type="text" id="Bed"><br>

                        <label for="Cook">Does your house have a kitchen</label>
                        <input type="text" id="Cook"><br>

                        <input type="submit" name="" id="sub" class="subm" onclick="House()">
        </div>
        <div id="addDetailsToPage">

                <p id="isPaint" class="houseDetails"></p>
                <p id="sq_Feet" class="houseDetails"></p>
                <p id="bathroom" class="houseDetails"></p>
                <p id="Bedroom" class="houseDetails"></p>
                <p id="Kitchen" class="houseDetails"></p>

        </div>
</div>
        <script src="House.js"></script>
</body>



Aucun commentaire:

Enregistrer un commentaire