Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Responsive design - break line image + text

Featured Replies

Hi guys!

 

I am doing a website in Joomla (+Yootheme template) and I am struggling with responsive design. I am not a total beginner in CSS /HTML but in the 'responsive' department I am very new. Your help will be much appreciated.

 

Basically I have an image + text + button. I want to break the composition in such a manner that the image, text and button get on top of each other after the screen gets smaller. An extra bonus would be the text paragraph to switch from

 

text-align:right
 

 

to

 

text-align:center;
 

 

If could this thing right I could apply it to many other sites I am planning to work on as I use the same design concept for frontpages!

 

Peter

post-54666-0-00343900-1362999378_thumb.jpg

You could set the widths of each element to 100% of their parent container but apply those queries depending on screen size. For example:

 

.img { float:left; width:30%; }
.link { float:left; width:20%; }
.btn { float:left; width:20%; }

@media @media (max-width:500px) {
    .img, .link, .btn { width:100%; }
}

 

That's probably not a great example, but I hope you get the idea.

 

Lyndsey.

I use a custom grid now where I specify the columns purely in the media queries. Could you not 'fill out' the elements to full width once you get down to a query such as min-width 480px, for example? It usually works for me. I like to keep things simple as possible. Like me ;) The issue I see arising though is whether what I suggested is going to add unnecessary markup or not...

Can you post the code? Don't know if this will work but you could put a class on those 3 elements and targeting them in a media query. Set each element to display:block and text-align:center

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.