How to make Responsive image - html

I'm working on my Django website and I get some unclear points according to my responsive website design.
My environment :
Django 2.0.1
HTML 5
CSS
Bootstrap 3.3.7
My issue :
I developped my Django website on my screen with this resolution : 1920*1080. Now I would like to adapt each HTML template to users screens.
I don't really have knowledges about responsive design because I'm mainly Back-End developper.
When I display my website on different screen size, CSS is not good at all. I assume pictures make my display very ugly because it's not totally responsive.
My code :
HTML Script :
<!-- This script lets to define homepage template for "Accueil" -->
{% extends 'Base_Accueil.html' %}
{% load staticfiles %}
{% load static %}
{% block content %}
<div id="content">
<br></br>
<div id="content-1">
<div id="presentation-title">
<p>Petit mot de l'Astrophotographe & Développeur du site</p>
</div>
<div id="presentation-text">
<p> Je vous souhaite la bienvenue sur mon site dédié à l'Astrophotographie. A travers votre parcours sur celui-ci, vous allez découvrir ma passion pour la photographie des objets de l'Univers. Du Soleil, notre étoile, aux galaxies les plus lointaines en passant par les vastes amas de gaz qui composent l'infiniment grand, vous allez pouvoir contempler des objets atypiques de part leurs formes et leurs couleurs.</p><br />
<p> C'est avec plaisir que je vous invite à vous balader sur mon site, découvrir ma galerie d'images, mes bricolages, mes articles & publications, ... Vous trouverez également le matériel astronomique employé pour la réalisation des différents clichés disponibles sur ce site ainsi que diverses informations complémentaires. N'hésitez pas à partager vos avis et à venir le visiter régulièrement pour entrevoir les nouvelles images astrophotographiques.</p><br />
<p align="center">Je vous souhaite une bonne visite !</p>
</div>
</div>
<br></br>
<div class="row">
</div>
<div id="content-2">
<div id="presentation-image-récente">
<p>Dernière image publiée</p>
</div>
<div id="presentation-image">
<li class="image">
<img src='{{photo.Image_upload.url}}'/>
<p></p>
<figcaption>
<div>
<center>
<p></p>
<p><b>{{photo.Nom}} ({{photo.Designation}})</b></p>
</center>
</div>
</figcaption>
</li>
</div>
</div>
<div class="row">
</div>
<br></br>
</div>
<p></p>
{% endblock content %}
CSS script :
#media (min-width: 1900px) {
body {
background-color: #4D4D4D;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
#banner {
width:100vw;
}
.navbar-collapse {
text-align:center;
background-color: #1B1B1B;
}
.navbar-nav {
background-color: #1B1B1B;
text-align:center;
display:inline-block;
float:none;
}
ul.nav.navbar-nav > li > a {
color : #00BFFF; /* Orange color*/
padding-top:10px !important;
padding-bottom:0 !important;
height: 35px;
}
.navbar {min-height:35px !important; background-color: #1B1B1B;}
.navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.active>a:focus, .navbar-inverse .navbar-nav>.active>a:hover {
background-color: transparent;
}
.dropdown-menu, .dropdown-menu > li > a {
background-color: #1B1B1B;
color: #00BFFF;
}
.dropdown-menu > li > a:hover {
background-color: transparent;
color : white;
}
.dropdown-menu > li.divider {
background: #00BFFF;
}
#content{
border-radius: 4px;
width: 70%;
margin: 0 auto;
background-color: #2E2E2E;
color : #C9C9C3;
box-shadow: rgba(0, 0, 0, 0.498039) 0px 0px 16px;
}
#content-1 {
border-radius: 4px;
width: 55%;
margin: 0 auto;
background-color: #2E2E2E;
color : #C9C9C3;
border-style: solid ;
border-width: 1px;
border-color: #00BFFF;
}
#content-2 {
border-radius: 4px;
width: 55%;
margin: 0 auto;
background-color: #2E2E2E;
color : #C9C9C3;
border-style: solid ;
border-width: 1px;
border-color: #00BFFF;
}
#content-messages {
border-radius: 4px;
width: 55%;
margin-left: 14%;
background-color: #2E2E2E;
color : #C9C9C3;
border-style: solid ;
border-width: 1px;
border-color: #00BFFF;
}
#footer{
border-radius: 4px;
width: 70%;
margin: 0 auto;
background-color: #1B1B1B;;
color : white;
margin-bottom: 1%;
padding-bottom: 1%;
-webkit-box-shadow: black 0px 0px 12px;
box-shadow: black 0px 0px 12px;
}
.footer-text, .footer-text-list {
color : #C9C9C3;
font-size: 12px;
text-align: justify;
font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
}
ul {
list-style-type: none;
}
p.footer-title {
margin-left:5%;
}
.footer-title {
margin-top: 14%;
color : white;
font-size: 26px;
font-family: 'Noto Serif', Georgia, Times, serif;
}
.col-lg-3 {
margin-left: 6%;
}
#presentation-author, #presentation-title, #presentation-image-récente, #galerie-image{
border-radius: 4px;
margin: 0 auto;
background-color: #00BFFF;
color : white;
font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
}
#presentation-author > p, #presentation-title > p, #presentation-image-récente > p, #galerie-image > p{
margin-left:4%;
font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
}
#presentation-description, #presentation-text {
margin-left: 2%;
font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img,
#presentation-image > img {
width: 100%;
margin: auto;
}
figcaption > div > p {
color : #00BFFF;
}
figure.effect-new:hover figcaption::before,figure.effect-new:hover p{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}
.image img {
max-width: 100%;
height: auto;
}
}
Examples from my website :
EDIT :
I removed media (min-width:1900px) and I modified .image img like this :
.image img {
max-width: 100%;
height: auto;
width: auto\9;
}
It seems to be responsive now, but is it the good solution ? Then, How I can do that with text parts ?

You only have one media query line in your code.
The result is that it will not perform any changes.
You need to have minimum 2 media queries, as described below:
#media only screen and (max-width: 1899px) {
body {
background-color: red;
}
}
#media only screen and (min-width: 1900px) {
body {
background-color: blue;
}
}
Apart from above responsiveness, If you want to control the format and position of your text and image, I suggest you implement CSS grid which is a grid system embedded in CSS.

I suggest reading a bootstrap tutorial - for the latest bootstrap (4); I like w3schools and here for images (with example here).
Bootstrap works on a grid system, to get the bare minimum of a responsive image (with bootstrap 3 syntax) add the class="container" parent div and class="img-responsive" to the img tag.
see below, I removed the image tag from your css and took out the django tags:
<!-- This script lets to define homepage template for "Accueil" -->
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="container" class="container">
<br></br>
<div id="content-1">
<div id="presentation-title">
<p>Petit mot de l'Astrophotographe & Développeur du site</p>
</div>
<div id="presentation-text">
<p> Je vous souhaite la bienvenue sur mon site dédié à l'Astrophotographie. A travers votre parcours sur celui-ci, vous allez découvrir ma passion pour la photographie des objets de l'Univers. Du Soleil, notre étoile, aux galaxies les plus lointaines en passant par les vastes amas de gaz qui composent l'infiniment grand, vous allez pouvoir contempler des objets atypiques de part leurs formes et leurs couleurs.</p><br />
<p> C'est avec plaisir que je vous invite à vous balader sur mon site, découvrir ma galerie d'images, mes bricolages, mes articles & publications, ... Vous trouverez également le matériel astronomique employé pour la réalisation des différents clichés disponibles sur ce site ainsi que diverses informations complémentaires. N'hésitez pas à partager vos avis et à venir le visiter régulièrement pour entrevoir les nouvelles images astrophotographiques.</p><br />
<p align="center">Je vous souhaite une bonne visite !</p>
</div>
</div>
<br></br>
<div class="row">
</div>
<div id="content-2">
<div id="presentation-image-récente">
<p>Dernière image publiée</p>
</div>
<div id="presentation-image">
<li class="image">
<img src='download.jpg' class="img-responsive" width="1900px" />
<p></p>
<figcaption>
<div>
<center>
<p></p>
<p><b>some (text)</b></p>
</center>
</div>
</figcaption>
</li>
</div>
</div>
<div class="row">
</div>
<br></br>
</div>
</body>
</html>
You'll want to play with row and column divs/tags to get your website singing nicely on all devices. Tutorials are great!

Related

HTML vertical navbar height up to the footer

I have this layout when the size of screen is greater than 768px:
But I want the vertical navbar height up to the footer even when resize the screen.
This is what I want:
with the background color obviously.
This is html file and css file!
article {
text-align: left;
}
header {
background: black;
color: white;
padding: 10px;
text-align: center;
}
nav {
background: #eee;
padding: 10px;
text-align: center;
}
ul {
list-style-type: none;
padding: 0; /*Tolgo il padding da ul*/
}
li a{
display: block; /* Separo per riga i padding*/
padding: 8px 16px;
color: #000; /* Rimuovo il classico colore viola del link*/
text-decoration: none; /*rimuovo la sottilineatura del link*/
}
li a:hover { /* Cosa fare quando il mouse si trova sopra*/
background-color: #555;
color: white;
}
footer{
background: #aaa;
color: white;
padding: 0px;
}
img{
padding: 10px;
height: 505px;
width: 829px;
}
/*Riposiziono gli elementi se la larghezza è >=768px per tutti i dispositivi*/
#media all and (min-width: 768px){
nav {
text-align: left;
max-width: 200px;
float: left; /*Sposto il contenuto a destra*/
}
article {
margin-left: 250px;
}
}
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
<link rel="stylesheet" href="Index.css">
</head>
<body>
<header>
<h1 id="T">Index</h1>
</header>
<nav>
<ul>
<li><a>Topologie</a></li>
<li><a>Classificazione</a></li>
<li><a>Dizionario terminologico</a></li>
<li>Domini</li>
<li><a>Apparati</a></li>
</ul>
</nav>
<article>
<h2>Definizione di Rete</h2>
Una rete di telecomunicazioni è un insieme di dispositivi e dei loro collegamenti
(fisici o logici) che consentono la trasmissione e la ricezione di informazioni di
qualsiasi tipo tra due o più utenti situati in posizioni geograficamente distinte,
effettuandone il trasferimento attraverso cavi, sistemi radio o altri sistemi elettromagnetici
o ottici.
<br><br><img src="Immagini/ImmagineRete.png">
</article>
<footer>
<p>Ultimo aggiornamento: Sabato 19 Maggio</p>
<p>Torna all'inizio</p>
</footer>
</body>
</html>
I want this behavior:
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_layout_flexbox
In the example above the navbar height expands to the footer.
I will wrap the nav and the article inside main tag and give it display: flex and it will take the highest height and also remove the float from the nav you don't need it as long as you are using dispaly:flex by default its flex-direction:row they will be next to each other
<main>
<nav></nav>
<article></article>
</main>
p { margin: 0; }
article {
text-align: left;
}
header {
background: black;
color: white;
padding: 10px;
text-align: center;
}
nav {
background: #eee;
padding: 10px;
text-align: center;
}
ul {
list-style-type: none;
padding: 0; /*Tolgo il padding da ul*/
}
li a{
display: block; /* Separo per riga i padding*/
padding: 8px 16px;
color: #000; /* Rimuovo il classico colore viola del link*/
text-decoration: none; /*rimuovo la sottilineatura del link*/
}
li a:hover { /* Cosa fare quando il mouse si trova sopra*/
background-color: #555;
color: white;
}
footer{
background: #aaa;
color: white;
padding: 0px;
}
img{
padding: 10px;
height: 505px;
width: 829px;
}
/*Riposiziono gli elementi se la larghezza è >=768px per tutti i dispositivi*/
#media all and (min-width: 768px){
main {
display: flex;
}
nav {
text-align: left;
max-width: 200px;
margin-right: 50px;
}
}
<header>
<h1 id="T">Index</h1>
</header>
<main>
<nav>
<ul>
<li><a>Topologie</a></li>
<li><a>Classificazione</a></li>
<li><a>Dizionario terminologico</a></li>
<li>Domini</li>
<li><a>Apparati</a></li>
</ul>
</nav>
<article>
<h2>Definizione di Rete</h2>
Una rete di telecomunicazioni è un insieme di dispositivi e dei loro collegamenti
(fisici o logici) che consentono la trasmissione e la ricezione di informazioni di
qualsiasi tipo tra due o più utenti situati in posizioni geograficamente distinte,
effettuandone il trasferimento attraverso cavi, sistemi radio o altri sistemi elettromagnetici
o ottici.
<br><br><img src="Immagini/ImmagineRete.png">
</article>
</main>
<footer>
<p>Ultimo aggiornamento: Sabato 19 Maggio</p>
<p>Torna all'inizio</p>
</footer>
</body>
</html>
Set the height of your nav to the height of the current screen size, I'm pretty sure this will do the job.
nav {
background: #eee;
padding: 10px;
text-align: center;
height: 100vh;
}

Issue with aligning using vh

I'm actually trying to create a navigation bar.
However I want it to be about 7vh and I want the font to adjust with this.
The problem is that the small hover effect border won't be aligned perfectly all the time (Display in fullscreen).
If anyone knows how to fix this it would be very much appreciated.
* {
font-family: Futura;
margin: 0px;
padding: 0px;
color: white;
font-weight: 400;
-webkit-font-smoothing: antialiased;
}
body {
background: #2b2b2a;
}
a {
text-decoration: none;
}
nav {
height: 7vh;
background-color: DeepSkyBlue;
text-align: center;
width: 100%;
position: fixed;
}
/* NOTE: Classes */
/* NOTE: Text elements */
.nav-link {
font-size: 4vh;
margin: 0px 1%;
vertical-align: bottom;
position: relative;
padding-top: 1vh;
top: 1vh;
}
.column-title {
font-size: 24px;
padding-bottom: 0.3vh;
}
.column-text {
text-align: left;
}
#premiere {
font-size: 3vh;
float: right;
transform: translate(-5%, -110%);
}
/* NOTE: Box elements */
.home-column-warper {
display: inline-table;
width: 100%;
text-align: center;
}
.column {
width: 22%;
margin: 2vh 1%;
display: inline-block;
border: 3px solid white;
vertical-align: top;
}
/* NOTE: Other */
.logo-image {
height: 5.5vh;
float: left;
margin-top: 0.7vh;
margin-left: 0.7vh;
transform: translate(0%, -110%)
}
.vline {
border-right: 3px solid white;
font-size: 20px;
padding-left: 6px;
}
.selected {
border-bottom: solid 3px LightBlue;
padding-bottom: 0.4vh;
}
::selection {
background: DeepSkyBlue;
}
/* NOTE: IDs */
#nav-warper {
width: 100%;
height: 6vh;
}
/* NOTE: Hover */
.nav-link:hover {
color: wheat;
border-bottom: solid 3px LightBlue;
padding-bottom: 0.4vh;
}
<!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta charset="utf-8">
<title>Bac 2018</title>
<link rel="stylesheet" href="./data/CSS/styling.css">
</head>
<body>
<nav>
<div id="nav-warper">
Accueil<a class="vline"></a>
Plans<a class="vline"></a>
Cours<a class="vline"></a>
Plus
</div>
<img src="./data/Media/logo.png" alt="Logo du site" class="logo-image">
<span id="premiere">Première Littéraire</span>
</nav><br><br><br>
<div class="home-column-warper">
<div class="column">
<p class="column-title">PLANS</p>
<span>Cette section regroupe tout les plans des oeuvres ou extraits vu en lecture analytique en français et littérature. Elle comporte quelques documents vu en lecture cursive ainsi que des résumés des oeuvres vu en classe. Pour obtennir la définition d'un mot passer le curseur dessus, les mots dotés d'une définition sont soulignés. Il est possible que certaines fiches contiennent des erreurs, idem pour les résumés d'oeuvres ou de documents en lecture cursive. Donc si vous voyez une erreur ou une information qui manque, envoyez moi un mail : miloertas#gmail.com, ça évitera que tout le monde apprennent un truc faux...</span>
</div>
<div class="column">
<p class="column-title">COURS</p>
<span>Cette section regroupe les principaux cours de l'année. Tout ce qui est notions, objets d'études ou en relation avec l'oral se retrouve dans cette section. Informations sur objets d'études et cours théorique également dedans</span>
</div>
<div class="column">
<p class="column-title">PLUS</p>
<span>Cette section regroupe toutes les notifications d'erreurs ou les documents inclassables. Bientôt cette section contiendra les documents scan des textes pour le bac oral.</span>
</div>
<div class="column">
<p class="column-title">MODIFICATIONS</p>
<span>Cette section regroupe toutes les modifications oppérés sur le site (Comprend la correction de bugs l'ajout de fonctionnalités et la correction d'erreur dans les fiches).<br>- Ajout de la section PLUS.<br>- Correction FICHE, Dom Juan v1 : "C'est une dimension tragique et non une tragédie".</span>
</div>
</body>
</html>
The reason the of the dis-align on the element hover is most likely beacause it doesnt exist before the hover takes place so add this Line:
border-bottom: solid 3px transparent;
To the:
.nav-link
Should probably Solve it :)

Hamburger menu font-size issue

My web site is html and css only. I wish it to remain so.
Web-site URL: www.yoga-grenoble.net.
I started to update a web site so that it displays best on mobile phone. I develop specific css with hamburger menu. However, I face an issue with the font-size within the hamburger menu. It displays normal on my PC browser (even when resizing the window as narrow as mobile phone) but very small on my mobile device (Motorola X).
Mobile web-site URL: www.yoga-grenoble.net/New
css:
www.yoga-grenoble.net/New/mobileMain.css
www.yoga-grenoble.net/New/mobileNav.css
By the way, I have the same issue with my h2 title in the header zone ("Centre de yoga de Grenoble").
I am stuck here. Do you have any idea where this comes from?
Chris.
--
Edit.
Code is quite huge that's why I only linked to it:
html:
www.yoga-grenoble.net/New/index.html
css:
www.yoga-grenoble.net/New/mobileMain.css
www.yoga-grenoble.net/New/mobileNav.css
index.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Centre de yoga de Grenoble</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Description" content="Centre de yoga de Grenoble- le clair de l'aube - accueil" />
<meta name="Author" content="CLe" />
<meta name="Expires" content="never" />
<meta name="Geography" content="Fontaine, 38600, Grenoble, 38000, France" />
<meta name="Keywords" content="Grenoble, Centre de yoga, yoga, nidra, meditation, shine, sophrologie,
, nidra, aromatherapie, medecine chinoise, acuponcture, Qi Gong, eidetique, yoga du rire, Clair de l'aube" />
<meta name="robots" content="index,follow" />
<meta name="google-site-verification" content="g8sdkSveYxKwvHWjNx-xV-eVFExRraxk_mCGhu4tf7Y" />
<link rel="stylesheet" type="text/css" href="./mobileMain.css" title="Normal" />
<link rel="stylesheet" type="text/css" href="./mobileNav.css" title="Normal" />
<!--
<link rel="stylesheet" type="text/css" media="screen and (max-width: 749px)" href="./mobileMain.css" title="Normal" />
<link rel="stylesheet" type="text/css" media="screen and (max-width: 749px)" href="./mobileNav.css" title="Normal" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 750px)" href="./fullWidthMain.css" title="Normal" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 750px)" href="./fullWidthNav.css" title="Normal" />
<link rel="shortcut icon" type="image/x-icon" href="./images/favicon.ico" />
-->
</head>
<body>
<div id="container">
<div id="header">
<h1>Le Clair de l'Aube</h1>
<img src="./images/LotusBanner.jpg" alt="Lotus du centre de yoga de Grenoble" class="leaves" />
<h2>Centre de yoga de Grenoble</h2>
</div>
<!-- Menu defilant: inclure dans le header : <link rel="stylesheet" type="text/css" href="./menu_defilant.css" title="Normal" /> -->
<nav class="nav">
<ul>
<li class="home current">Accueil</li>
<li class="visite">Visite</li>
<li class="activites">Activités ▶
<ul>
<li class="subact_EcoleDeYogaDeGrenoble">Ecole de yoga de Grenoble</li>
<li class="subact_KailashNathYoga">Yoga avec Guillaume</li>
<li class="subact2">Yoga avec Marisel</li>
<li class="subact2">Pilates avec Marjolaine</li>
<li class="subact_eidetique">Image eidétique</li>
<li class="subact_yogaDuRire">Yoga du rire</li>
<li class="subact_medecineChinoise">Médecine chinoise</li>
<li class="subact_aromatherapie">Aromathérapie</li>
<li class="subact_sophrologie">Sophrologie</li>
<li class="subact_meditation">Méditations</li>
<li class="subact_QiGong">Qi Gong</li>
</ul>
</li>
<li class="calendrier">Planning</li>
<li class="contact">Contact</li>
<li class="plan">Plan</li>
</ul>
</nav> <!-- Fin menu defilant -->
<div id="leftnav">
<p style="margin-bottom: 0px;">Partager</p>
<ul class="partage">
<li id="share-facebook"><img src="./images/icones/facebook.png" alt="Share on Facebook" /></li>
<li id="share-twitter"><img src="./images/icones/twitter.png" alt="Tweet this" /></li>
<li id="share-delicious"><img src="./images/icones/delicious.png" alt="Add to delicious" /></li>
<li id="share-google"><img src="./images/icones/google.png" alt="Share on Google +" /></li>
<li id="share-linkedin"><img src="./images/icones/linkedin.png" alt="Share on LinkedIn" /></li>
</ul>
<p><br /><br /></p>
<h1>Liens</h1>
<p>Plan du site web</p>
</div>
<div class="article">
<h1>Année 2016 - 2017</h1>
<div class="article_info">
Par Nathalie
</div>
<p>
C'est la rentrée aussi au Clair de l'Aube, les activités hebdomadaires ont repris le 12
septembre, avec quelques nouveautés :
</p>
<ul>
<li>Le yoga avec Nathalie : cours le lundi matin, midi et soir + le mercredi midi et soir ; ateliers réguliers. Et le cours en quinzaine pour les enfants du mercredi
après-midi grandit pour la tranche d'àge des 7-14 ans, avec un nouveau cours pour les 11-17 ans le jeudi de 16h30 à 17h30, et toujours les ateliers mensuels
parents-enfants avec les 3-5 ans, et les plus grands ensuite 6-10 ans, le samedi matin</li>
<li>Le qi gong avec Delphine : cours le mardi midi et nouvel horarire le jeudi soir de 19h à 20h15</li>
<li>Le yoga avec Guillaume : 2 cours le mardi soir + une prolongation possible méditation-souffle de 21h30 à 22h</li>
<li>La méditation avec Nathalie (les mercredi soir de 20h à 21h en quinzaine)</li>
<li>Le cours de Pilates avec Marjolaine le mercredi matin se poursuit et se complète d'un créneau le jeudi de 17h45 à 18h45</li>
<li>Le yoga-nidra avec Nathalie (certains mercredi soir)</li>
<li>Un nouveau cours de yoga avec Marisel, le jeudi midi</li>
<li>Le yoga du rire avec Nathalie (certains vendredi midi) et aussi avec Frédérire</li>
<li>La sophrologie avec Jacqueline passe sous la forme d'ateliers mensuels certains vendredi soirs</li>
</ul>
<p>
Et toujours, sur rendez-vous, des soins traditionnels chinois avec Delphine et maintenant aussi Isabelle le vendredi.
</p>
<p>
Plus d'informations sont disponibles dans l'onglet activités.
</p>
<p>
Jacques Vigne animera 3 jours de méditation les mardi 29 novembre, mercredi 30 et jeudi 1er décembre... à suivre pour les inscriptions déjà ouvertes !
</p>
<p>
Au plaisir de vous recevoir au Clair de l'Aube.
</p>
</div>
<div class="footer">
<h1>© Le Clair de l'Aube 2015</h1>
</div>
</div>
</body>
</html>
css: mobileMain.css
/* CSS Document */
body {
background-color:#ffff99;
font-family:Georgia, "Times New Roman", Times, serif;
font-size:0.74em;
color:#000000;
line-height:20px;
cursor:default;
margin:0;
}
#container {
min-width:400px;
padding:10px;
background-color:#FFFFFF;
margin:0 auto 0 auto;
}
#header {
background-color:#3F4A3E;
font-weight:bold;
}
#header img {
visibility: hidden;
width: 0px;
}
#header h1 {
color:#FFFFFF;
font-family:"Trebuchet MS", Arial, Verdana;
font-weight:bold;
padding:0;
padding-left:20px;
padding-top:10px;
padding-bottom:20px;
margin:0;
border-bottom:2px solid #ffffff;
font-size:150%;
}
#header h2 {
color: #ffffff;
float: right;
font-family:"Trebuchet MS", Arial, Verdana;
font-size:120%;
letter-spacing: +0px;
margin:0;
margin-top: -30px; /* rattrapage de l'image */
margin-right:10px;
text-indent:5px;
background-image:none;
border-bottom:0;
}
.leaves {
border-right:2px solid #ffffff;
float:left;
}
#leftnav {
border:1px solid #cccccc;
padding:5px;
float:right;
clear:left;
margin-top: -50px;
background-image: url("images/backgrounds/case_background.jpg");
background-position:bottom right;
background-repeat:repeat-x;
height: 25px;
}
#leftnav h1, #leftnav p a {
visibility: hidden;
}
#leftnav p {
margin-top: -6px;
}
#leftnav ul {
float: right;
height: 26px;
margin: 0;
padding: 2px 0 0 0;
color: #747B83;
margin-top: -8px;
}
#leftnav ul li {
display: inline-block;
color: #747B83;
margin: 0 2px;
vertical-align: middle;
height: 13px;
}
#leftnav ul li img {
border: none;
}
#sidebar h1,h2,h3 {
font-family:Arial Narrow, Arial, Helvetica, sans-serif;
letter-spacing:-1px;
color:#000000;
border:none;
background-image:none;
}
.article {
margin-left:0px; /* compared to 170px for full width */
padding:10px;
border: 1px solid #cccccc;
margin-bottom:10px;
background-image: linear-gradient(white, #eeeeee);
background-size: 50%;
background-repeat: repeat-x;
background-position: bottom;
}
.article p {
margin:10px;
}
.article_info {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
color:#666666;
letter-spacing:2px;
font-variant:small-caps;
text-transform:lowercase;
}
.article_info a {
font-weight:bold;
text-decoration:none;
color:#000000;
}
.article_large {
margin-left:0px;
padding:10px;
border: 1px solid #cccccc;
background-position:top left;
background-repeat:no-repeat;
margin-bottom:10px;
background-image: linear-gradient(white, #eeeeee);
background-size: 50%;
background-repeat: repeat-x;
background-position: bottom;
}
.article_large p {
margin:10px;
}
.article h1, .article h2, .article h3, .article_large h1, .article_large h2, .article_large h3 {
font-family:Arial Narrow, Arial, Helvetica, sans-serif;
letter-spacing:-1px;
color:#000000;
border-bottom:2px solid #cccccc;
background-image: url("images/backgrounds/lotus_bullet.png");
background-position:top right;
background-repeat:no-repeat;
padding-bottom:5px;
padding-top:5px;
margin-top: 30px;
}
.footer {
background-color:#3F4A3E;
font-weight:bold;
}
.footer h1 {
color:#FFFFFF;
font-family:"Trebuchet MS", Arial, Verdana;
font-weight:bold;
text-align: right;
padding:0;
padding-right:20px;
padding-top:10px;
padding-bottom:20px;
margin:0;
border-bottom:2px solid #ffffff;
font-size:120%;
}
a {
color:#9ACC53;
text-decoration:none;
}
a:hover {
color: tomato;
text-decoration: underline;
}
mobileNav.css:
.nav {
position: relative;
min-height: 25px;
margin: 5px 0 20px 0;
padding: 0;
}
.nav ul {
width: 120px;
min-height: 25px;
margin:0;
padding: 2px 0;
position: absolute;
top: 0;
left: 0;
border: solid 1px #aaa;
background: url(./images/icones/icon-menu.png) no-repeat 10px 10px;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
/* center nav */
.nav ul li.home {background:url(./images/icones/home.png) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.visite {background:url(./images/icones/visite.png) no-repeat, linear-gradient(white, #cfcfcf);}
.nav ul li.activites {background:url(./images/icones/activites.png) no-repeat, linear-gradient(white, #cfcfcf);;}
.nav ul li.calendrier {background:url(./images/icones/calendrier.png) no-repeat, linear-gradient(white, #cfcfcf);;}
.nav ul li.contact {background:url(./images/icones/contact.png) no-repeat, linear-gradient(white, #cfcfcf);;}
.nav ul li.plan {background:url(./images/icones/plan.png) no-repeat, linear-gradient(white, #cfcfcf);;}
.nav li {
display: none; /* hide all <li> items */
float: left;
min-height: 25px;
padding: 0;
width: 120px;
margin: 0;
z-index:10;
background: linear-gradient(white, #cfcfcf);
}
.nav ul .current {
display: block; /* show only current <li> item */
background: url(./images/icones/icon-menu.png) no-repeat 10px 10px, linear-gradient(white, #cfcfcf);
}
.nav ul li.current{
background: url(./images/icones/icon-menu.png) no-repeat 10px 10px, linear-gradient(white, #cfcfcf);
}
.nav a, a.visited {
display: block;
padding: 5px 5px 5px 32px;
text-align: left;
color: #000;
}
.nav .current a {
background: none;
color: #000;
}
/* on nav hover */
.nav ul:hover {
background-image: none;
}
.nav ul:hover li {
display: block;
margin: 0;
}
.nav ul:hover .current {
background: url(./images/icones/icon-check.png) no-repeat 10px 11px, linear-gradient(white, #cfcfcf);
}
.nav ul li ul {
display: none;
}
/* submenu */
.nav ul li.subact_EcoleDeYogaDeGrenoble {background:url(./images/icones/subact_EcoleDeYogaDeGrenoble.gif) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_KailashNathYoga {background:url(./images/icones/subact_KailashNathYoga.gif) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_meditation {background:url(./images/icones/subact_meditation.gif) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_yogaDuRire {background:url(./images/icones/subact_yogaDuRire.png) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_sophrologie {background:url(./images/icones/subact_sophrologie.jpg) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_medecineChinoise {background:url(./images/icones/subact_medecineChinoise.jpg) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact2 {background:url(./images/icones/subact2.gif) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_aromatherapie {background:url(./images/icones/subact_aromatherapie.jpg) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_danse {background:url(./images/icones/subact_danse.gif) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_eidetique {background:url(./images/icones/subact_imageEidetique.png) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_psychotherapie {background:url(./images/icones/subact4.gif) no-repeat, linear-gradient(white, #cfcfcf)}
.nav ul li.subact_QiGong {background:url(./images/icones/subact_QiGong.jpg) no-repeat, linear-gradient(white, #cfcfcf)}
/* Sub Menus */
.nav li ul {
position: absolute;
margin-top: -1px;
margin-left: 120px;
display: none;
width: 220px;
}
.nav li:hover ul {
display: block;
}
.nav li ul li {
display: block;
min-height: 25px;
width: inherit;
padding-left: 0px;
}
/* partage nav */
.nav.right ul {
left: auto;
right: 0;
margin-top: -50px;
}
/* center nav */
.nav.center ul {
left: 0%;
margin-left: 0px;
}
There is problem with responsive design. I don't see viewport. Try add this:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
or find more on page below:
https://developer.mozilla.org/en/docs/Mozilla/Mobile/Viewport_meta_tag

Horizontal menu fit 100%, text stack to the left

I have an horizontal menu and I can't find the way to make it fit with the 100% of my centered container page (from left side to right side).
Also I want every html main lists to get at the left side of the horizontal menu.
I think it's something related to my CSS code...
Right now my website looks like this: Link to image
body {
background-color: #2A2A2A;
}
h1 {
color: #FCFCFC;
padding-left: 8px;
background-color: 494949;
width: 100%;
height: 50px;
margin: 0px 0px 7px 0px;
/* margen arriba , margen dercha, margen abajo, margen izquierda */
border-bottom: 2.5px solid #C69AD3;
/*sombra color del solido*/
font-family: 'Oswald', sans-serif;
text-shadow: 3px 3px #353535;
font-size: 200%;
}
.center {
margin: auto;
width: 100%;
padding: 10px;
text-align: left;
text-align: bottom;
}
p {
color: white;
font-family: 'Oswald', sans-serif;
text-shadow: 0, 5px 0, 5px #343434
}
* {
margin: 0px;
/* colocacion del header en los id="header" */
padding: 0px;
/* colocacion del header en los id="header" */
}
#container {
width: 80%;
margin: 0 auto;
text-align: left;
}
#header {
background: #545;
margin: 3px 5px 3px 0x;
/* margen arriba , margen dercha, margen abajo, margen izquierda */
color: white;
font-family: 'Oswald', sans-serif, Helvetica, sans-serif;
text-shadow: 1px 1px #494949;
}
ul,
ol {
text-align: center;
list-style: none;
/* con el "list-style:none" hacemos que no se vean puntos ni otras formas en las listas, de modo que las palabras quedan solas en forma de lista. */
overflow: hidden;
}
.nav > li {
float: left;
/*posicion del menu horizontal*/
}
.nav li a {
background-color: 494949;
/*Color botones menú sin seleccion*/
color: #fff;
text-decoration: none;
/* quitamos el subrallado */
padding: 10px 100px;
/* altura y anchura del menu */
display: block;
margin: 0px 0px 1px 1px;
/* margen arriba , margen dercha, margen abajo, margen izquierda */
}
.nav li a:hover {
/* "hover" es cuando tienes el mouse encima*/
background-color: #6B6B6B;
}
.nav li ul {
display: none;
position: absolute;
/* posicion en cuando se despliega el menu, absolute=se abre y no mueve nada, relative=se desplaza todo objeto que este debajo */
white-space: nowrap;
text-align: left;
}
.nav li:hover > ul {
display: block;
}
.nav li ul li ul {
right: -140px;
top: 0px;
}
<html>
<head>
<title>Practica A3</title>
<link rel="stylesheet" type="text/css" href="estilo1.css" />
</head>
<div id="container">
<h1 class="center">Hello this is the website</h1>
<body>
<div id="header">
<nav class="menu-fixed">
<!-- Iniciamos la etiqueta del menu -->
<ul class="nav">
<!-- Inicio TODO -->
<li>Inicio
</li>
<!-- Principal -->
<li>Servicios
<!-- Principal -->
<ul>
<!-- Inicio secundaria -->
<li>Compra de entradas
</li>
<!-- Secundaria -->
<li>Consulta de conciertos
</li>
<!-- Secundaria -->
<li>Salas privadas
</li>
<!-- Secundaria -->
<li>Reserva de mesas
</li>
<!-- Secundaria -->
</ul>
<!-- Final secundaria -->
</li>
<li>Acerca de
<!-- Principal -->
<ul>
<!-- Inicio secundaria -->
<li>Submenu1
</li>
<!-- Secundaria -->
<li>Submenu2
</li>
<!-- Secundaria -->
<li>Submenu3
</li>
<!-- Secundaria -->
<li>Submenu4
</li>
<!-- Secundaria -->
</ul>
<!-- Final secundaria -->
</li>
<li>Contacto
</li>
<!-- Principal -->
</ul>
<!-- Final TODO -->
</nav>
<!-- Cerramos el menu con la nav -->
</div>
</br>
</br>
</br>
</br>
</br>
<p>Este es contenido de la pagina web. Simplemente se trata de un texto laaaaaaargo para ver como se posiciona y que tal quedaria con el resultado final.</br>
Esto es todo, gracias por la atencion.</p>
</body>
</div>
</html>
Also Live on fiddleYour navbar is get the full-width(80%) of container. Now the problem is you set the h1 and .center class width 100% with border-bottom. If you remove the width of h1 and .center class it will get inside the container width.
And the menu text center issue set the .nav li a {padding: 10px 100px 10px 10px;} like this. Also in your css some useless property which I comment out in css part and also try to give a short description with comment.
If you have any question regarding this . you can ask me in comment section. Thanks
body {
background-color: #2A2A2A;
}
h1 {
color: #FCFCFC;
padding-left: 8px;
background-color: #494949;
/*In here you don't set # so the color not showing */
height: 50px;
margin: 0px 0px 7px 0px;
/* margen arriba , margen dercha, margen abajo, margen izquierda */
border-bottom: 2.5px solid #C69AD3;
/*sombra color del solido*/
font-family: 'Oswald', sans-serif;
text-shadow: 3px 3px #353535;
/* font-size: 200%; [By default h1 font-size 2em means 200% so I don't think you need to use it again ] */
}
.center {
margin: auto;
padding: 10px;
text-align: left;
/*text-align: bottom; [This css is invalid. Three types is valid text-align: left/center/right]*/
}
p {
color: white;
font-family: 'Oswald', sans-serif;
text-shadow: 0, 5px 0, 5px #343434
}
* {
margin: 0px;
/* colocacion del header en los id="header" */
padding: 0px;
/* colocacion del header en los id="header" */
}
#container {
width: 80%;
margin: 0 auto;
/*text-align: left; [it means inside all text element will be align left. Don't use it here. User where you need. ] */
}
#header {
background: #545;
/* margin: 3px 5px 3px 0x; [This margin will be invalid coz you missed the "P" from last 0px] */
/* margen arriba , margen dercha, margen abajo, margen izquierda */
color: white;
font-family: 'Oswald', sans-serif, Helvetica, sans-serif;
text-shadow: 1px 1px #494949;
}
/*Change ul,ol class like this other wise if you have any other list item in your body section will be effected. This is also a example of valid css selctor. */
ul.nav,
.nav li ul {
list-style: none;
/* con el "list-style:none" hacemos que no se vean puntos ni otras formas en las listas, de modo que las palabras quedan solas en forma de lista. */
overflow: hidden;
}
.nav > li {
float: left;
/*posicion del menu horizontal*/
}
.nav li a {
background-color: #494949;
/*Again in here you don't set # so the color not showing */
/*Color botones menú sin seleccion*/
color: #fff;
text-decoration: none;
/* quitamos el subrallado */
padding: 10px 100px 10px 10px;
/*This is for the left to right menu*/
/* altura y anchura del menu */
display: block;
/*margin: 0px 0px 1px 1px; [This is margin create the gap between every li a tag if you want that gap you can use this.*/
/* margen arriba , margen dercha, margen abajo, margen izquierda */
}
.nav li a:hover {
/* "hover" es cuando tienes el mouse encima*/
background-color: #6B6B6B;
}
.nav li ul {
display: none;
position: absolute;
/* posicion en cuando se despliega el menu, absolute=se abre y no mueve nada, relative=se desplaza todo objeto que este debajo */
white-space: nowrap;
text-align: left;
}
.nav li:hover > ul {
display: block;
}
.nav li ul li ul {
right: -140px;
top: 0px;
}
<!DOCTYPE html>
<html>
<head>
<title>Practica A3</title>
<link rel="stylesheet" type="text/css" href="estilo1.css" />
</head>
<body>
<div id="container">
<h1 class="center">Hello this is the website</h1>
<div id="header">
<nav class="menu-fixed">
<!-- Iniciamos la etiqueta del menu -->
<ul class="nav">
<!-- Inicio TODO -->
<li>Inicio
</li>
<!-- Principal -->
<li>Servicios
<!-- Principal -->
<ul>
<!-- Inicio secundaria -->
<li>Compra de entradas
</li>
<!-- Secundaria -->
<li>Consulta de conciertos
</li>
<!-- Secundaria -->
<li>Salas privadas
</li>
<!-- Secundaria -->
<li>Reserva de mesas
</li>
<!-- Secundaria -->
</ul>
<!-- Final secundaria -->
</li>
<li>Acerca de
<!-- Principal -->
<ul>
<!-- Inicio secundaria -->
<li>Submenu1
</li>
<!-- Secundaria -->
<li>Submenu2
</li>
<!-- Secundaria -->
<li>Submenu3
</li>
<!-- Secundaria -->
<li>Submenu4
</li>
<!-- Secundaria -->
</ul>
<!-- Final secundaria -->
</li>
<li>Contacto
</li>
<!-- Principal -->
</ul>
<!-- Final TODO -->
</nav>
<!-- Cerramos el menu con la nav -->
</div>
<br>
<br>
<br>
<br>
<br>
<p>Este es contenido de la pagina web. Simplemente se trata de un texto laaaaaaargo para ver como se posiciona y que tal quedaria con el resultado final.<br>Esto es todo, gracias por la atencion.</p>
</div><!--End #Container DIV -->
</body>
</html>

:after and :before don't work in radio input on Firefox

I have a problem with Mozilla Firefox, I have used a pseudo element to create a radio button with line between the two.
Here is the complete source code:
/* IMPORTATION DES FONTS */
#font-face {
font-family: 'Open_Sans-Semi-Bold';
src: url("../fonts/Open_Sans/OpenSans-Bold.ttf");
}
#font-face {
font-family: 'Open_Sans-Regular';
src: url("../fonts/Open_Sans/OpenSans-Regular.ttf");
}
#font-face {
font-family: 'Open_Sans-Light';
src: url("../fonts/Open_Sans/OpenSans-Light.ttf");
}
#font-face {
font-family: 'Oleo_Script-Bold';
src: url("../fonts/Oleo_Script/OleoScript-Bold.ttf");
}
#font-face {
font-family: 'Oleo_Script-Regular';
src: url("../fonts/Oleo_Script/OleoScript-Regular.ttf");
}
/* MISE EN PLACE DES CONTAINERS */
body {
background-color: #7CCCD6 !important;
/* Pourra être supprimé lors du passage vers le projet commun */
}
/* Définition de la taille de base du container d'inscription */
.container-registerS2 {
width: 340px;
}
/* MISE EN PLACE DU CONTAINER PRINCIPAL */
.panel.registerS2 {
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: 3px 3px 15px 0px rgba(0, 0, 0, 0.45);
-moz-box-shadow: 3px 3px 15px 0px rgba(0, 0, 0, 0.45);
box-shadow: 3px 3px 15px 0px rgba(0, 0, 0, 0.45);
border: 0;
}
.panel-body.registerS2 {
padding-left: 3%;
padding-right: 3%;
}
/* Classe permettant de donner un design différent au header du panel (couleur etc...) */
.panel-heading.registerS2 {
margin-bottom: 0!important;
font-family: 'Open_Sans-Semi-Bold' !important;
-moz-border-radius: 0px;
-webkit-border-radius: 20px 20px 0px 0px;
border-radius: 20px 20px 0px 0px;
background-color: #BD9470;
height: 62px;
text-align: center;
color: white;
font-weight: bold;
font-size: 15px;
}
/* GESTION DES INPUT */
/* Container de chaque input qui permet d'accueillir leur input ainsi que leurs icônes */
.input-registerS2 {
width: 87%;
float: none;
margin: auto;
margin-bottom: 10px;
}
/* Form-control correspond à la classe présente dans toutes les input qui lui donne son design */
.form-control {
outline: 0;
height: 49px;
width: 310px;
border: solid 1px #BAB9B8;
-webkit-border-radius: 8px !important;
-moz-border-radius: 8px !important;
border-radius: 8px !important;
padding-left: 8%;
font-family: 'Open_Sans-Regular' !important;
font-size: 18px;
-webkit-appearance: none;
}
/* Gestion de la couleur des placeholder dans plusieurs navigateurs */
.form-control::-webkit-input-placeholder {
color: #BAB9B8;
}
.form-control:-moz-placeholder {
color: #BAB9B8;
}
.form-control::-moz-placeholder {
color: #BAB9B8;
}
.form-control:-ms-input-placeholder {
color: #BAB9B8;
}
/* Gestion de l'apparence des icones */
.icon.registerS2 {
color: #FFFCFA;
}
/* GESTION DES INPUT AVEC ICONES */
/* Container des input avec icônes */
.form-control-icon-registerS2 {
width: 87%;
float: none;
margin: 0 auto;
border-bottom-right-radius: 0px!important;
border-top-right-radius: 0px!important;
border-right: 0;
}
/* Container des icônes */
.input-group-addon.registerS2 {
width: 52px;
border-bottom-right-radius: 8px !important;
border-top-right-radius: 8px !important;
background-color: #BAB9B8;
border: solid 1px #96999B !important;
}
/* GESTION DE L'AFFICHAGE DE CERTAINS TEXTES */
p.required.registerS2 {
text-align: start;
color: #919191;
margin: 0;
}
p.center-block.registerS2 {
color: #919191;
}
p.step-text.registerS2 {
color: #FFFCFA;
font-family: Open_Sans-Semi-Bold;
font-size: 15px;
padding-bottom: 8px;
}
p.panel-content.registerS2 {
padding-top: 0.5em;
font-size: 125%;
}
/* GESTION DU CENTRAGE DES ELEMENTS EN BLOCK */
.center-block.registerS2 {
float: none;
margin: 0 auto;
text-align: center;
}
.center-table.registerS2 {
margin-left: auto;
margin-right: auto;
}
/* GESTION DU BOUTON (CHANGEMENT DES COULEURS + BORDURES) */
.btn.registerS2 {
background-color: #F7821E;
border: solid 2px #6D390D;
}
/* AFFICHAGE D'UN CURSEUR DIFFERENT SUR LE DATEPICKER */
#datepicker {
cursor: pointer;
}
/* GESTION DU TABLEAU CONTENANT LES BOUTONS AINSI QUE LA LIGNE */
td.registerS2 input.registerS2 {
position: relative;
}
td.registerS2 input.registerS2:after {
display: block;
content: " ";
position: absolute;
bottom: 11px;
background: #FFFCFA;
height: 3px;
width: 35px;
right: -36px;
}
td.registerS2:last-child input.registerS2:after {
display: none;
}
td.registerS2 {
padding-right: 34px;
}
/* GESTION DU DESIGN DU BOUTON RADIO */
input[type="radio"].registerS2 {
-webkit-appearance: none;
display: none;
background-color: #FFFCFA;
display: inline-block;
width: 24px;
height: 24px;
vertical-align: middle;
cursor: pointer;
-moz-border-radius: 50%;
border-radius: 50%;
border: solid 1px #BAB9B8;
}
input[type="radio"].registerS2:checked:before {
content: "";
display: block;
position: relative;
width: 10px;
height: 10px;
border-radius: 50%;
background: #7CCCD6;
margin: 6px;
border: solid 1px #BAB9B8;
}
input[type="radio"].registerS2:focus {
outline: none;
}
#media only screen and (max-width: 360px) {
.container-registerS2 {
width: 290px;
}
.form-control {
width: 260px;
padding-left: 8%;
font-family: 'Open_Sans-Regular' !important;
font-size: 15px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<br/>
<p class="center-block step-text registerS2"><b>Étape 2/2</b>
</p>
<table class="center-table registerS2">
<tbody>
<tr>
<td class="registerS2">
<input class="registerS2" name="step" id="step1" type="radio" disabled>
</td>
<td>
<input class="registerS2" name="step" id="step2" type="radio" checked>
</td>
</tr>
</tbody>
</table>
<br/>
<div class="row">
<div class="container-registerS2 center-block">
<div class="panel panel-default registerS2">
<div class="panel-heading registerS2">
<p class="panel-content registerS2">Informations personnelles</p>
</div>
<div class="panel-body registerS2">
<div id="alert"></div>
<br/>
<div class="input-group input-registerS2 registerS2">
<p class="required registerS2">*champs requis</p>
<input type="text" class="form-control registerS2" placeholder="Prénom*" id="firstname" name="firstname">
</div>
<div class="input-group input-registerS2 registerS2">
<input type="text" class="form-control registerS2" placeholder="Nom*" id="name" name="name">
</div>
<div class="input-group input-registerS2 registerS2">
<input type="text" class="form-control form-control-icon-registerS2" placeholder="Date de naissance*" id="birthday" name="birthday" aria-describedby="datepicker">
<span class="input-group-addon registerS2" id="datepicker"><i
class="fa fa-calendar fa-2x icon registerS2" aria-hidden="true"></i></span>
</div>
<div class="input-group input-registerS2 registerS2">
<input type="tel" class="form-control form-control-icon-registerS2" placeholder="N° de smartphone*" id="number" name="number" aria-describedby="phone">
<span class="input-group-addon registerS2" id="phone"><i
class="fa fa-mobile fa-2x icon registerS2" aria-hidden="true"></i></span>
</div>
<div class="input-group input-registerS2 registerS2">
<input type="text" class="form-control registerS2" placeholder="Code de vérification" id="verification" name="verification">
</div>
<br/>
<button type="button" class="btn btn-warning btn-lg center-block registerS2">C'est parti !</button>
<br/>
<p class="center-block registerS2">Le n° de smartphone est nécessaire au paiement qui s'effectuera par mobile</p>
</div>
</div>
</div>
</div>
https://jsfiddle.net/ar557477/
In Google Chrome it works like a charm! But in Firefox it is a disaster!
On Firefox:
On Google Chrome:
The incorrect behaviour in this case would appear to be Chrome. Pseudo elements are added inside the element and input elements are not allowed to contain any content. You get the same result in IE as you do in Firefox.
Because of this the best way of achieving your desired result would be to move the pseudo element to the containing element instead.
Change td.registerS2 input.registerS2:after to td.registerS2:after
Change right: -36px; to right: 0; on td.registerS2:after
Add position: relative; to td.registerS2
/* IMPORTATION DES FONTS */
#font-face {
font-family: 'Open_Sans-Semi-Bold';
src: url("../fonts/Open_Sans/OpenSans-Bold.ttf");
}
#font-face {
font-family: 'Open_Sans-Regular';
src: url("../fonts/Open_Sans/OpenSans-Regular.ttf");
}
#font-face {
font-family: 'Open_Sans-Light';
src: url("../fonts/Open_Sans/OpenSans-Light.ttf");
}
#font-face {
font-family: 'Oleo_Script-Bold';
src: url("../fonts/Oleo_Script/OleoScript-Bold.ttf");
}
#font-face {
font-family: 'Oleo_Script-Regular';
src: url("../fonts/Oleo_Script/OleoScript-Regular.ttf");
}
/* MISE EN PLACE DES CONTAINERS */
body {
background-color: #7CCCD6 !important;
/* Pourra être supprimé lors du passage vers le projet commun */
}
/* Définition de la taille de base du container d'inscription */
.container-registerS2 {
width: 340px;
}
/* MISE EN PLACE DU CONTAINER PRINCIPAL */
.panel.registerS2 {
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: 3px 3px 15px 0px rgba(0, 0, 0, 0.45);
-moz-box-shadow: 3px 3px 15px 0px rgba(0, 0, 0, 0.45);
box-shadow: 3px 3px 15px 0px rgba(0, 0, 0, 0.45);
border: 0;
}
.panel-body.registerS2 {
padding-left: 3%;
padding-right: 3%;
}
/* Classe permettant de donner un design différent au header du panel (couleur etc...) */
.panel-heading.registerS2 {
margin-bottom: 0!important;
font-family: 'Open_Sans-Semi-Bold' !important;
-moz-border-radius: 0px;
-webkit-border-radius: 20px 20px 0px 0px;
border-radius: 20px 20px 0px 0px;
background-color: #BD9470;
height: 62px;
text-align: center;
color: white;
font-weight: bold;
font-size: 15px;
}
/* GESTION DES INPUT */
/* Container de chaque input qui permet d'accueillir leur input ainsi que leurs icônes */
.input-registerS2 {
width: 87%;
float: none;
margin: auto;
margin-bottom: 10px;
}
/* Form-control correspond à la classe présente dans toutes les input qui lui donne son design */
.form-control {
outline: 0;
height: 49px;
width: 310px;
border: solid 1px #BAB9B8;
-webkit-border-radius: 8px !important;
-moz-border-radius: 8px !important;
border-radius: 8px !important;
padding-left: 8%;
font-family: 'Open_Sans-Regular' !important;
font-size: 18px;
-webkit-appearance: none;
}
/* Gestion de la couleur des placeholder dans plusieurs navigateurs */
.form-control::-webkit-input-placeholder {
color: #BAB9B8;
}
.form-control:-moz-placeholder {
color: #BAB9B8;
}
.form-control::-moz-placeholder {
color: #BAB9B8;
}
.form-control:-ms-input-placeholder {
color: #BAB9B8;
}
/* Gestion de l'apparence des icones */
.icon.registerS2 {
color: #FFFCFA;
}
/* GESTION DES INPUT AVEC ICONES */
/* Container des input avec icônes */
.form-control-icon-registerS2 {
width: 87%;
float: none;
margin: 0 auto;
border-bottom-right-radius: 0px!important;
border-top-right-radius: 0px!important;
border-right: 0;
}
/* Container des icônes */
.input-group-addon.registerS2 {
width: 52px;
border-bottom-right-radius: 8px !important;
border-top-right-radius: 8px !important;
background-color: #BAB9B8;
border: solid 1px #96999B !important;
}
/* GESTION DE L'AFFICHAGE DE CERTAINS TEXTES */
p.required.registerS2 {
text-align: start;
color: #919191;
margin: 0;
}
p.center-block.registerS2 {
color: #919191;
}
p.step-text.registerS2 {
color: #FFFCFA;
font-family: Open_Sans-Semi-Bold;
font-size: 15px;
padding-bottom: 8px;
}
p.panel-content.registerS2 {
padding-top: 0.5em;
font-size: 125%;
}
/* GESTION DU CENTRAGE DES ELEMENTS EN BLOCK */
.center-block.registerS2 {
float: none;
margin: 0 auto;
text-align: center;
}
.center-table.registerS2 {
margin-left: auto;
margin-right: auto;
}
/* GESTION DU BOUTON (CHANGEMENT DES COULEURS + BORDURES) */
.btn.registerS2 {
background-color: #F7821E;
border: solid 2px #6D390D;
}
/* AFFICHAGE D'UN CURSEUR DIFFERENT SUR LE DATEPICKER */
#datepicker {
cursor: pointer;
}
/* GESTION DU TABLEAU CONTENANT LES BOUTONS AINSI QUE LA LIGNE */
td.registerS2 input.registerS2 {
position: relative;
}
td.registerS2:after {
display: block;
content: " ";
position: absolute;
bottom: 11px;
background: #FFFCFA;
height: 3px;
width: 35px;
right: 0;
}
td.registerS2:last-child input.registerS2:after {
display: none;
}
td.registerS2 {
padding-right: 34px;
position: relative;
}
/* GESTION DU DESIGN DU BOUTON RADIO */
input[type="radio"].registerS2 {
-webkit-appearance: none;
display: none;
background-color: #FFFCFA;
display: inline-block;
width: 24px;
height: 24px;
vertical-align: middle;
cursor: pointer;
-moz-border-radius: 50%;
border-radius: 50%;
border: solid 1px #BAB9B8;
}
input[type="radio"].registerS2:checked:before {
content: "";
display: block;
position: relative;
width: 10px;
height: 10px;
border-radius: 50%;
background: #7CCCD6;
margin: 6px;
border: solid 1px #BAB9B8;
}
input[type="radio"].registerS2:focus {
outline: none;
}
#media only screen and (max-width: 360px) {
.container-registerS2 {
width: 290px;
}
.form-control {
width: 260px;
padding-left: 8%;
font-family: 'Open_Sans-Regular' !important;
font-size: 15px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<p class="center-block step-text registerS2"><b>Étape 2/2</b>
</p>
<table class="center-table registerS2">
<tbody>
<tr>
<td class="registerS2">
<input class="registerS2" name="step" id="step1" type="radio" disabled>
</td>
<td>
<input class="registerS2" name="step" id="step2" type="radio" checked>
</td>
</tr>
</tbody>
</table>
<br/>
<div class="row">
<div class="container-registerS2 center-block">
<div class="panel panel-default registerS2">
<div class="panel-heading registerS2">
<p class="panel-content registerS2">Informations personnelles</p>
</div>
<div class="panel-body registerS2">
<div id="alert"></div>
<br/>
<div class="input-group input-registerS2 registerS2">
<p class="required registerS2">*champs requis</p>
<input type="text" class="form-control registerS2" placeholder="Prénom*" id="firstname" name="firstname">
</div>
<div class="input-group input-registerS2 registerS2">
<input type="text" class="form-control registerS2" placeholder="Nom*" id="name" name="name">
</div>
<div class="input-group input-registerS2 registerS2">
<input type="text" class="form-control form-control-icon-registerS2" placeholder="Date de naissance*" id="birthday" name="birthday" aria-describedby="datepicker">
<span class="input-group-addon registerS2" id="datepicker"><i
class="fa fa-calendar fa-2x icon registerS2" aria-hidden="true"></i></span>
</div>
<div class="input-group input-registerS2 registerS2">
<input type="tel" class="form-control form-control-icon-registerS2" placeholder="N° de smartphone*" id="number" name="number" aria-describedby="phone">
<span class="input-group-addon registerS2" id="phone"><i
class="fa fa-mobile fa-2x icon registerS2" aria-hidden="true"></i></span>
</div>
<div class="input-group input-registerS2 registerS2">
<input type="text" class="form-control registerS2" placeholder="Code de vérification" id="verification" name="verification">
</div>
<br/>
<button type="button" class="btn btn-warning btn-lg center-block registerS2">C'est parti !</button>
<br/>
<p class="center-block registerS2">Le n° de smartphone est nécessaire au paiement qui s'effectuera par mobile</p>
</div>
</div>
</div>
</div>