Category: HTML

  • CSS / JavaScript: Twitter Bootstrap center modal vertically on mobile web view

    I’ve been working with modal boxes using Twitter Bootstrap. And the page I’m working on needs to be viewed in mobile devices. The modal looks nice and centered when viewed on desktop, but when run in mobile web browsers, it’s aligned to the top.

    Someone on StackOverflow suggested the use of a helper div plus some custom CSS to align Bootstrap modals vertically.

    Code for modal:

    CSS:

    Source: Vertically centering Bootstrap modal window

  • Wrapping text in table cells and DIV tags

    I’ve been doing research on how to wrap texts. First solution I found was giving the CSS property word-wrap the value break-word:

    word-wrap: break-word

    But this didn’t work in Firefox.
    (more…)

  • Inline Frame that automatically adjusts its height for the source page

    Last year, I was working on our MULPROJ layout, and the type of layout I was making needed an iframe whose height is auto resized according to the source page’s content. This means that there should be no vertical scrollbar in the iframe, it simply adjusts itself vertically.

    I thought that it wasn’t possible to do this but I found a JavaScript code that can do the trick, and I just want to share it with you. 😉
    (more…)