0
<style ="text/css">
.asd123 {
height: 100px;
width: 900px;
margin: auto;
border: 3px dashed black;
}
.asd123_text {
font-family: Garamond;
font-size: 62px;
}
</style>
<body>

<div class="asd123">

        <p class="asd123_text" style="padding-top:-50px; text-align:center; position:absolute;">generictext</p>

</div>

How can I make the paragraph text stack over the div or something?

I am pretty new to css and html but I do understand some of it, however css is starting to get really stupid

1
  • What do you mean by "stack over the div"? Commented Oct 18, 2013 at 5:51

1 Answer 1

1

just remove the styles you have give, just make margin:0

            <div class="asd123">

    <p class="asd123_text" style="">generictext</p>

and css

   .asd123 {
      height: 100px;
      width: 900px;
     margin: auto;
     border: 3px dashed black;
     }
     .asd123_text {
         font-family: Garamond;
         font-size: 62px;
         margin:0    ;
         text-align:center
          }
Sign up to request clarification or add additional context in comments.

2 Comments

thanks @Rhea but how can i move the text down a few px's? padding wont work
you can set the margin accordingly. or just margin-top margin:0 was necessary because p tag adds default margin of its own, and that is why your p was going below the div

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.