473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Responsive img?

Hi!

I was wondering how to make my images responsive so they end up under each other at the same time when they reach the breaking point? I want the to go from horisontal to vertical, all three at the same time if that makes any sense?

And also, how do I put text underneath the each image that follows when I adjust the size of the screen? I want the breaking point to be at 600px.

Here's the HTML:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.   <head>
  3.     <title>Fitness Junkies</title>
  4.     <meta charset="utf-8">
  5.     <link rel="stylesheet" href="main.css">
  6.       <link href="https://fonts.googleapis.com/css?family=Julius+Sans+One|Open+Sans+Condensed:300" rel="stylesheet">
  7.   </head>
  8.  
  9.   <body>
  10.       <header>
  11.         <h1>Fitness Junkies</h1>
  12.         <p style="font-size:1.8rem;"></p>
  13.       </header>
  14.  
  15.       <ul class="nav">
  16.   <li><a href="index1.html">Startsida</a></li>
  17.   <li><a href="träning.html">Träning</a></li>
  18.   <li><a href="kost.html">Kost</a></li>
  19.   <li><a href="inspo.html">Inspo</a></li>
  20. </ul>
  21.  
  22.       <h2> Artiklar</h2>
  23.       <main>
  24.           <section>
  25.               <ul>
  26.                   <li><img src="kost.jpg">  </li>
  27.  
  28.                   <li><img src="fitness.jpg"> </li>
  29.  
  30.                   <li><img src="inspo.jpg"> </li>
  31.  
  32.               </ul>
  33.           </section>
  34.       </main>
  35.  
  36.  
  37.       <footer>&copy; 2018 | Linnéa Bengtsson</footer>
  38.  
  39. </body>
  40.  
  41. </html>
And the CSS:

Expand|Select|Wrap|Line Numbers
  1. /* Basic styles and resets */
  2. body,html,h1,h2,p, div,a,img,header,footer,span,section{
  3.     margin: 0;
  4.     padding: 0;font-family: 'Julius Sans One', sans-serif;
  5. }
  6. footer,header{
  7.     background: ; color: lightgreen;  text-align: center; padding: 2em 0;
  8.     opacity: 0.7;
  9.     font-family:  'Julius Sans One', sans-serif;
  10. }
  11.  
  12. footer { font-size: 3rem;
  13.  
  14.  
  15. }
  16.  
  17. header {
  18.  
  19.     font-size: 5rem;
  20. }
  21. html,body{
  22.     width: 100%;
  23. }
  24. html{
  25.     font-size: 62.5%; 
  26. }
  27. body{ 
  28.     position: relative; font-size: inherit;
  29. }
  30.  
  31. /* Styling for the image distribution part */
  32. ul, li, img{
  33.     margin: 0;
  34.     padding: 0;
  35. }
  36. section ul{
  37.     width: 100%;
  38.     margin: 0 auto;
  39.     text-align: center;
  40. }
  41. section ul li{
  42.     list-style-type: none;
  43.     display: inline-block;
  44.     margin: 2rem 0;
  45.  
  46. }
  47. section ul::after{
  48.     content: "";
  49.     width: 100%;
  50.     display: inline-block;
  51.     margin:4rem;
  52. }
  53.  
  54. /*Meny*/
  55. .nav {
  56.   background: white;
  57.   columns: 100px 4;
  58. column-gap: 3px;
  59.     list-style-type: none;
  60.  
  61.  
  62. }
  63.  
  64. .nav a {
  65.   text-decoration: none;
  66.     font-size: 15pt;
  67.     font-weight: bold;
  68.   color: #696969;
  69.   display: block;
  70.   padding: 1em;
  71.   text-align: center;
  72.   border-bottom: 1px solid "grey";
  73.  
  74. }
  75. .nav a:hover {
  76.   background:#F5F5F5;
  77.  
  78. }
  79.  
  80. h2 {
  81.     text-align: center;
  82.     color: palegreen;
  83.     font-size: 30px;
  84.     font-family: 'Julius Sans One', sans-serif;
  85.     padding: 17px;
  86. opacity: 0.9;}

And yes, I am a beginner as you probably can tell so no judge please haha :)
Jan 5 '18 #1
1 26221
tdrsam
97 64KB
You should probably use media queries. This page should help you find out about them. If you need more information, just google it.

You would probably use something like this:

Expand|Select|Wrap|Line Numbers
  1. @media only screen and (max-width: 600px) {
  2.     section ul li{
  3.          display: block;
  4.     }
  5. }
  6.  
Hope that helps :)
May 8 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jim Christiano | last post by:
I've created a C# window's form application that migrates data. As it migrates data, the program itself is non-responsive. I would like to implement a cancel button to stop the migration...
2
by: Jawahar | last post by:
All, I have an application in asp.net the application opens a lot of Modal diaglog pages. When modal dialogs are close the parent aspx page is often un-responsive. I mean I can click the buttons...
4
by: Urs Vogel | last post by:
Hi I would like to set a Windows.Form into a non responsive state, i.e. that it does not respond to user input of any kind, similar to the state a forms gets when another modal form is opened...
2
by: blueturtle | last post by:
Hi, I'm newbie to C#, and I would like to know what is the common solution to a problem that I encounter. The scenario: Performing a long task, without blocking the UI thread, so it will stay...
0
by: NoelByron | last post by:
I need to do some intense calculations in my application. Those are done by a third party Python library and consume 100% CPU time for some seconds. The computations take place in their own thread...
5
by: Radu | last post by:
Hi. I need to implement a "phone-book" kind of feature - I have a list of about 50.000 people, and the user should be able to find anyone by typing either the (beginning of the) last name, either...
1
by: Developer111 | last post by:
In my (VB.Net+VS2008) application, I want to make my windows form (splash) more responsive as there is some complex functionality is performing while loading splash form. Currently when any other...
0
by: parker81 | last post by:
I'm trying to build a responsive header for a website that I'm designing using the fittext.js plug-in. The text is scaling perfectly but I can't figure out how to nudge the text down so that the...
4
by: kumaraja | last post by:
Hi, I am planning to build a web application based on responsive design so it is compatible with most devices (Desktop, laptop, tablets etc.). The application will have super admin, admin and user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.