Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8310

    I work with shortcodes to divide image and text.

    But, how can I influence the shortcode to align the text to the top.

    [one_half first]

    [/one_half]

    [one_half]

    My text is here and needs to be aligned on the top.

    [/one_half]

    1) can I add a attribute to the shortcode?

    2) can I enter a definition into custom.css

    #60996

    Hey,

    as far as I know there’s no css attribute “align to top”. You can only center align text (horizontally and not vertically) or float it. Only tables offer an attribute called “valign”. However you’d need to create a table within the shortcode to vertical align the text.

    #60997

    yes, you are right. I mean “valign=top”. Still, with or without <table> the formatting is not working.

    The top of the image in the first half is not at the same height as the text in the second half.

    On other wordpress websites that I use, I solved this with <tables>, but I thought I could solve this with shortcodes…..

    #60998

    Maybe WP adds a paragraph between the text blocks. Instead of:

    [one_half first]

    [/one_half]
    [one_half]
    My text is here and needs to be aligned on the top.
    [/one_half]

    try:

    [one_half first]

    [/one_half] [one_half]
    My text is here and needs to be aligned on the top.
    [/one_half]

    #60999

    Yes, this works!

    #61000

    Glad that I could help you :)

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘shortcodes and alignment’ is closed to new replies.