Grow your CSS skills. Land your dream job.

When would text exceed boundaries

  • # March 10, 2013 at 11:56 pm

    I have an area, rightcol, in which are defined two classes, login-form and remositorymodule.

    Rightcol is defined as float: right, width: 185px; It displays as expected.

    login-form appears to have no width attributes, and displays correctly within the bounds of rightcol. Even if I modify the text (through firebug) to be excessively long, it still wraps correctly within the boundaries of rightcol.

    Class remositorymodule does not behave as expected, and I can see from firebug that its boundaries extend outside of rightcol. Unsurprisingly some text from within remositorymodule displays outside of those boundaries, which is of course not what I want.

    Apart from width percentages , remositorymodule appears to have no width styling, and even if I remove any width references it still doesnt behave correctly.

    My question is, what could cause this behavior, aside from an explicit width: xx pixels?

    The HTML in question is listed below, and you’ll have to take my word for it that remositorymodule displays what looks like 5 or 10% outside of the boundaries of rightcol.

    div id=”rightcol”>
    form id=”login-form” method=”post” action=”/hk4wd/index.php?option=com_content&view=article&id=11&Itemid=67″>
    div class=”login-greeting”> Hi localhost,
    div class=”logout-button”>
    /form>
    table class=”remositorymodule”>
    tbody>
    tr class=”sectiontableentry2″>
    td class=”number” valign=”middle”>
    Nov.27



    Minutes of General Meeting November 13th 2012.pdf

    Nov.05



    Minutes of committee Meeting October 23rd 2012.pdf

    # March 11, 2013 at 3:19 am

    Create a codepen of what you are talking about.

    # March 11, 2013 at 4:47 am

    Can you point me to what a codepen is and how I do it please?

    I hace also discovered that this happens when the text has no spaces in it before the length of the container is exceeded. Diesnt solve it, but its a step in the right direction.

    # March 11, 2013 at 5:17 am

    http://bit.ly/ZCX3U0

    Codepen ist a tool to create Live Testcases which can be edited and seen by others.
    Alternatives would be jsfiddle or webdav, but we prefer codepen.

    Also: you have not even posted valid HTML (opening tag brackets missing “< " )

    # March 11, 2013 at 6:26 am

    Thanks Martin – Ok I get that now. I A small learning curve, you know how it is trying to stay focussed without branching off :-) But I’ll take a look.

    Yes I had to miss off the opening brackets otherwise the quote feature of this forum didnt display my HTML, I think it must have interpreted it or something … I did try indenting it for readability as well, but that didnt get me far either.

    Dont get me wrong, its not like Ive never been on a web forum or quoted pieces of code in a post – far from it!

    # March 11, 2013 at 8:27 am

    Ah this is why.
    However, we can only help you if you provide a testcase on jsfiddle or http://codepen.io/pen/

    Just insert your code there.

    # March 11, 2013 at 12:03 pm

    Without looking at your code in action, I obviously can’t say for sure, but it sounds like setting table-layout: fixed; on the containing table might do the trick.

    Might I ask why you’re using tables instead of a CSS-based layout?

    # March 11, 2013 at 7:21 pm

    You’re absolutely spot on thanks :-).

    I did look at table-layout, but I must have applied it incorrectly amongst my other efforts. I was somewhat focussed on text wrapping and truncation rather than the actual table parameters.

    And with Google being my friend, as it is when you already know what you’re looking for, I now understand why my table (-layout) was extending past its definition despite my attempts with ellipsis and word wrap, since that is the default – the crucial point being I had a long string of unbroken text which would push the table out and stubbornly refuse to truncate or wrap it. It all works as desired now, thankyou :-)

    Ah tables – Im using them only because I have to! The code is generated by a Joomla extension which I blame rather than myself for the use of tables here!

    thanks (the time Ive now saved can perhaps be invested in investigating a codepen!)

    # March 11, 2013 at 7:34 pm

    Glad I could help. I run into this a lot when building HTML email templates.

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".