Aligning elements

email

#1

Hello How can I align my image to the text?

I want to align the text "Easing out of illness" to the image.


#2

I used display:inherit; on the text on the right.


#3

Hi csosa,
I'm afraid that page your working with has some serious problems.

You are using html tables for page layout and it is filled with depreciated inline styles.
The code in that page is outdated

You can bring yourself up to date on html and css here


#4

They are for emails my friend not web pages


#5

:slight_smile: Carry On!


#6

That's not really the right approach.:slight_smile:

The problem is simply the default top margin on the p element. Set the top margin on all your p elements to zero (using inline-css for emails). The same would apply to h(n) tags also as they also have default top (and bottom) margins.

Your display:inherit worked because it turned the p element into a display:table-cell element and table-cells cannot have margins and thus was ignored. However the likelihood of email clients understanding that rule would be less than the margin rule. It also means that the element becomes a table-cell and you get all the behaviours that go with it which may trip you up later.


#7

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.