Jump to content

margin-top and div


WesleyA

Recommended Posts

I have a question about margin-top.

 

I made a css script with span columns. The higher columns are supposed to push the lower ones down. I place them in a div, in here multiple columns.

 

The second column though, takes the top of the outer div as reference (not sure if that tis called parent). I find this strange. I tried to make a second div inside but it didnt work.

 

Can you only use div as a reference point or also a span element or p ?

Link to comment
Share on other sites

Without seeing the code or a link to the page, I can only guess that you have conflicts coming from inappropriate combinations of properties that impact positioning.

Link to comment
Share on other sites

Sorry I didnt post the code yet.

 

I solved the problem above by making divs around the spans and set the position.

 

But actually I think I can simplify my script.

 

I give an example, imagine you have a div and a span inside like this:

    <htmL>
     <div class='pos1'>
      <span class = 'con1'>
      <div class= 'pos2'>
       <span class = 'con2'>
     </span>
      </span>
     </div>
     </div>



    </html>

this is basically how i installed a parent child block where con1 is the parent and can2 the child. For simple html this works, but now, while I'm going to loop it, it has its limitations, so I would like to set it all in css.

 

Is there a parent property or can you set the selectors in the css script?

Edited by WesleyA
Link to comment
Share on other sites

If only that was valid html passed by html validator, I might! Have considered helping.

 

I'm not sure if my code is correct, but this principle worked for me.

 

I'm looking for a way to create text containers that pad down the rest of the page.

 

How is a parent child element created then in html? And how is it done in css?

Link to comment
Share on other sites

too bad. The thing is I'm no expert at css. Actually I'm like totally unintelligent.

 

But the positive thing is that I'm willing to learn.

 

I have a lot of questions. Dozens!

 

for anybody who likes to answer questions please ... is it possible to use position relative and overflow in a way that the lower text moves downwards?

Link to comment
Share on other sites

Hmmm.... there seems to be a communication problem here. CSS is worthless to you if the HTML is not correct. The code you posted does not come anywhere near being valid and until you have correct HTML you cannot expect any consistent performance of either layout or presentation.

 

So let me see if I can make this clear.

 

YOU WILL NOT GET ANYTHING TO WORK RELIABLY IN HTML OR CSS UNTIL YOU FIX YOUR ERRORS

Edited by COBOLdinosaur
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...