CSS is a container, and I expect to integrate API field value result into container. Could you please indicate how to proceed please?
Have a good day.
head
<style>
.container {
background-color:#fff;
border-radius:20px;
padding:100px 60px;
width:200px;
box-shadow: rgba(50,50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
}
</style>
body
<div class="container">METEO CHAVENAY</div>
<div id='temperature'>"temperature"</div> c° (temperature)
<span id='pressure'>"pressure"</span> hpa (pression par rapport au niveau de la mer)
<span id='visibility'>"visibility"</span> km (visibilité horizontale)
<span id='windspeed'>"windspeed"</span> km/h (vitesse du vent)
<span id='winddire'>"winddire"</span> ° (direction du vent)
<span id='clouds'>"clouds"</span> % (couverture nuageuse)
<span id='sunrise'>"sunrise"</span> (Heure du lever du soleil)
<span id='sunset'>"sunset"</span> (Heure du coucher du soleil)
<span id='timezone'>"timezone"</span> H GMT Time zone
</div>
try to put the fields INSIDE the div block with that css class:
<div class="container">
METEO CHAVENAY
<div id='temperature'>"temperature"</div> c° (temperature)
<span id='pressure'>"pressure"</span> hpa (pression par rapport au niveau de la mer)
<span id='visibility'>"visibility"</span> km (visibilité horizontale)
<span id='windspeed'>"windspeed"</span> km/h (vitesse du vent)
<span id='winddire'>"winddire"</span> ° (direction du vent)
<span id='clouds'>"clouds"</span> % (couverture nuageuse)
<span id='sunrise'>"sunrise"</span> (Heure du lever du soleil)
<span id='sunset'>"sunset"</span> (Heure du coucher du soleil)
<span id='timezone'>"timezone"</span> H GMT Time zone
</div>
</div>
Then, why all those double quotes?
And, why not put everything BETWEEN the div or span blocks? Normally there is no need to put text outside those blocks. But that is not the CSS problem.
To get width working on the div, you might want to add in the css:
display: inline-block;
It looks like you need more experience. I would focus on the basics first, before using complicated CSS like box-shadow.
Related
I'm creating a website for a class and I need a part of the <p> to have a certain padding but it's only applying to the first line.
The HTML is :
<p>
Some text
<span class="tabulation">
Une ambiance conviviale
<br>
Durant l'été, une grande terrasse ensoleillée
<br>
En hiver, une verrière chauffée
<br>
De l'espace de stationnement
<br>
Un chef cuisinier d'expérience
<br>
Des salles privées pour les repas de groupe
<br>
Un menu pour enfant
<br>
Une vue sur le fleuve
</span>
</p>
What happens is that the span only applies to the first line. I know it's from the br, but I don't know how could I make it work. Thank you
Depending on what you're trying to achieve, try making your span display:block or display: inline-block
.tabulation {
padding: 2em;
display: block;
}
<p>
Some text
<span class="tabulation">
Une ambiance conviviale
<br>
Durant l'été, une grande terrasse ensoleillée
<br>
En hiver, une verrière chauffée
<br>
De l'espace de stationnement
<br>
Un chef cuisinier d'expérience
<br>
Des salles privées pour les repas de groupe
<br>
Un menu pour enfant
<br>
Une vue sur le fleuve
</span>
</p>
Also, see understanding inline box model
Rather than relying on the <br/> element - I would use spans with display: block applied to them - this will force them to be on individual lines and will allow you to apply styling directly to them for the padding etc.
Alternatively - if the children items are a list with the text at the top as a heading - you could use a <ul> or a <dl>. The advantage of a <dl> is that you get the <dt> element to provide the headings and the <dd> elements are already block level elements so you just need to space them out as desired.
.tabulation span {
display: block;
padding: 8px 16px;
}
.tabulation dd {
padding: 8px 16px;
margin: 0
}
<p class="tabulation">
Some text (using spans to show the items)
<span>Une ambiance conviviale</span>
<span>Durant l'été, une grande terrasse ensoleillée</span>
<span>En hiver, une verrière chauffée</span>
<span>De l'espace de stationnement</span>
<span>Un chef cuisinier d'expérience</span>
<span>Des salles privées pour les repas de groupe</span>
<span>Un menu pour enfant</span>
<span>Une vue sur le fleuve</span>
</p>
<hr/>
<dl class="tabulation">
<dt>Some text (using a DL to show the items)</dt>
<dd>Une ambiance conviviale</span>
<dd>Durant l'été, une grande terrasse ensoleillée</dd>
<dd>En hiver, une verrière chauffée</dd>
<dd>De l'espace de stationnement</dd>
<dd>Un chef cuisinier d'expérience</dd>
<dd>Des salles privées pour les repas de groupe</dd>
<dd>Un menu pour enfant</dd>
<dd>Une vue sur le fleuve</dd>
</dl>
I want to know how can I move this text next to an image! I don't know how I made it with the first pic, but I couldn't with the second.
p.mytext {
color: aliceblue;
padding-left: 15px;
padding-right: 15px;
padding-top: 15px;
padding-bottom: 15px;
border: 2px solid;
border-color: whitesmoke;
margin-left: 90px;
margin-right: 750px;
margin-bottom: 150px;
font-family: Lucida Sans Unicode;
}
p.secondtext {
color: white;
border: 2px solid;
border-color: whitesmoke;
font-family: Lucida Sans Unicode;
padding-left: 15px;
padding-right: 15px;
margin-left: 90px;
margin-right: 500px;
float: left;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>About me</title>
<link href="../CSS/main.css" rel="stylesheet" type="text/css">
</head>
<img class="clip" src="../images/clip.png" width="300">
<body id="aboutme">
<h1 class="titulo">About me</h1>
<h2>INFORMATION</h2>
<img class="picofme" src="../images/juli.JPG" width="400">
<p class="mytext"> First of all, thank you for visiting my website. My name is Julian, I am 24 years old and I was born in Bogota, Colombia; a beautiful country in South America. I consider myself a person that is really passionate for the art. Sometimes people ask me
what's my favorite field, and I never have a concrete answer. This world is full of many incredible things, that is really hard to choose what I love the most. I wanted to be a singer before, but I realized my talent didn't exist. Even though my singing
is horrible, I consider myself a music lover (I can play the guitar). After so many years trying to figure what my passion was, I found the film as the perfect way to express what I feel. There are days in which I wish I knew everything about the
film, but then I think everything is a process. I love traveling to different places, and taking pictures of everything. Right now, I am enjoying this stage of my life, where I learn new things every day. "Life is like a ladder where you give steps
every day"</p>
<img class="china" src="../images/china.JPG" width="450">
<p class="secondtext">A lo largo de 1808, las presiones de Napoleón desencadenaron una serie de acontecimientos que empeoraron aún más la ya comprometida situación española, el rey Carlos IV de España abdicó el trono a favor de su hijo Fernando el 19 de marzo de 1808 después
de los sucesos del motín de Aranjuez, y más tarde, el 5 de mayo de 1808 se terminó de consumar el desastre para España cuando Carlos IV y su hijo fueron obligados a ceder el trono a Napoleón Bonaparte en Bayona para designar a su hermano, José, como
nuevo rey de España. Esto provocó una gran reacción popular en España que desencadenó lo que hoy se conoce como la guerra de la Independencia española y tanto en América como en España, se formaron juntas regionales que fomentaron la lucha contra
los invasores franceses para restablecer en el trono al monarca legítimo.</p>
</body>
</html>
i suppose you want to this.
.flex {
display:flex;
margin: 20px 0;
}
.flex img {
margin:0 20px 0 0;
}
.flex p {
border: 2px solid;
border-color: whitesmoke;
padding:20px;
margin:0;
}
<img class="clip" src="https://picsum.photos/300/100">
<body id="aboutme">
<h1 class="titulo">About me</h1>
<h2>INFORMATION</h2>
<div class="flex">
<img class="picofme" src="https://picsum.photos/300/300" width="400" >
<p class="mytext"> First of all, thank you for visiting my website. My name is Julian, I am 24 years old and I was born in Bogota, Colombia; a beautiful country in South America. I consider myself a person that is really passionate for the art. Sometimes people ask me what's my favorite field, and I never have a concrete answer. This world is full of many incredible things, that is really hard to choose what I love the most. I wanted to be a singer before, but I realized my talent didn't exist. Even though my singing is horrible, I consider myself a music lover (I can play the guitar). After so many years trying to figure what my passion was, I found the film as the perfect way to express what I feel. There are days in which I wish I knew everything about the film, but then I think everything is a process. I love traveling to different places, and taking pictures of everything. Right now, I am enjoying this stage of my life, where I learn new things every day. "Life is like a ladder where you give steps every day"</p>
</div>
<div class="flex">
<img class="china" src="https://picsum.photos/300/300" width="450">
<p class="secondtext">A lo largo de 1808, las presiones de Napoleón desencadenaron una serie de acontecimientos que empeoraron aún más la ya comprometida situación española, el rey Carlos IV de España abdicó el trono a favor de su hijo Fernando el 19 de marzo de 1808 después de los sucesos del motín de Aranjuez, y más tarde, el 5 de mayo de 1808 se terminó de consumar el desastre para España cuando Carlos IV y su hijo fueron obligados a ceder el trono a Napoleón Bonaparte en Bayona para designar a su hermano, José, como nuevo rey de España. Esto provocó una gran reacción popular en España que desencadenó lo que hoy se conoce como la guerra de la Independencia española y tanto en América como en España, se formaron juntas regionales que fomentaron la lucha contra los invasores franceses para restablecer en el trono al monarca legítimo.</p>
</div>
</body>
A couple of pointers to mention:
The body tag does not need an id, the id should be added to a
div tag within the body
Your first image is above the body tag, remember to include all of
your content html within the body
Your paragraphs have many similar style property values, consider
making a class for these. You can add more than one class to a tag.
Avoid adding inline css: your img widths are very similar in width.
For demo purposes, I have created a class with width of 425 (midway) and
removed the 400/425 inline style
I commented out margins that were throwing out position, and changed the color text to black for the paragraphs (just so I could see it!)
The bottom img classes (in my code) that are commented out are examples of css that you could use for your images. The img css that affects the snippet is in the second line.
#aboutme{float:left;}
p{color:#000000; width:60%; display:inline-block; float:right;}
img{max-width:32%; padding:30px 25px; float:left; height:auto; vertical-align:middle;}
p, img{ display:inline-block; vertical-align:top;}
.mytext {
/*color: aliceblue;*/
padding: 15px;
border: 2px solid;
border-color: whitesmoke;
/*margin-left: 90px;
margin-right: 75px;
margin-bottom: 150px;*/
font-family: Lucida Sans Unicode;
}
.secondtext {
/*color: #ffffff;*/
border: 2px solid;
border-color: whitesmoke;
font-family: Lucida Sans Unicode;
padding-left: 15px;
padding-right: 15px;
/*margin-left: 90px;
margin-right: 500px;*/
/*float: left;*/
}
/*.picofme{width:400px;height:auto;}
.china{width:450px;height:auto;}*/
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>About me</title>
<link href="../CSS/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<img id="clip" src="https://ec.europa.eu/education/sites/education/files/styles/news_promo_img/public/questions-image.png?itok=6LsRlXS4" >
<div id="aboutme">
<h1 class="titulo">About me</h1>
<h2>INFORMATION</h2>
<img class="picofme" src="https://ec.europa.eu/education/sites/education/files/styles/news_promo_img/public/questions-image.png?itok=6LsRlXS4" >
<p class="mytext"> First of all, thank you for visiting my website. My name is Julian, I am 24 years old and I was born in Bogota, Colombia; a beautiful country in South America. I consider myself a person that is really passionate for the art. Sometimes people ask me
what's my favorite field, and I never have a concrete answer. This world is full of many incredible things, that is really hard to choose what I love the most. I wanted to be a singer before, but I realized my talent didn't exist. Even though my singing
is horrible, I consider myself a music lover (I can play the guitar). After so many years trying to figure what my passion was, I found the film as the perfect way to express what I feel. There are days in which I wish I knew everything about the
film, but then I think everything is a process. I love traveling to different places, and taking pictures of everything. Right now, I am enjoying this stage of my life, where I learn new things every day. "Life is like a ladder where you give steps
every day"</p>
<img class="china" src="https://ec.europa.eu/education/sites/education/files/styles/news_promo_img/public/questions-image.png?itok=6LsRlXS4" >
<p class="secondtext">A lo largo de 1808, las presiones de Napoleón desencadenaron una serie de acontecimientos que empeoraron aún más la ya comprometida situación española, el rey Carlos IV de España abdicó el trono a favor de su hijo Fernando el 19 de marzo de 1808 después
de los sucesos del motín de Aranjuez, y más tarde, el 5 de mayo de 1808 se terminó de consumar el desastre para España cuando Carlos IV y su hijo fueron obligados a ceder el trono a Napoleón Bonaparte en Bayona para designar a su hermano, José, como
nuevo rey de España. Esto provocó una gran reacción popular en España que desencadenó lo que hoy se conoce como la guerra de la Independencia española y tanto en América como en España, se formaron juntas regionales que fomentaron la lucha contra
los invasores franceses para restablecer en el trono al monarca legítimo.</p>
</div>
</body>
</html>
Good luck
My current situation is like this: http://i.imgur.com/qq15FEK.png
I have a panel, where the heading and border are the same color. I've overwritten the panel-info default color to use my own.
My problem is the small white gap between the heading and the border. I've tried changing the padding and border styles, but to no avail.
How do I make the heading take up the whole space of the panel, so as to remove the gap that appears?
/* This is the CSS that overrides the default bootstrap panel. */
.panel-info>.panel-heading {
color: #000 !important;
background-color: #6fc45b !important;
}
.panel-info {
border-color: #6fc45b !important;
}
<div class="col-sm-12">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Lejeperiode</h3>
</div>
<div class="panel-body">
Højsæson er skolernes vinterferie, sommerferie samt efterårsferie. I disse uger trækkes der lod. I højsæsonen kan man ikke booke weekender, med mindre de er ledige. I lavsæsonen kan man leje hele ugen, weekender samt mandag til torsdag. Weekender samt
mandag til torsdag bekræftes først en måned inden, da de altid kan overgåes af udlejning af hele ugen.
</div>
</div>
</div>
Try
.panel-heading {
margin-right:-1px;
margin-left:-1px;
}
i use the following code to put text beside image:
<div style="display:inline-block;vertical-align:bottom">
<p><img src="CIMA/CimaMetanoia.png" alt="Cool" height="50%" width="50%" /></p>
</div>
<div style="display:inline-block;">
<p class="text">
<div> <font color="#d54646"><b>MOVIDA</b> es un ministerio christiano, latino, internacional <br> e interdenominacional con el propósito de: </font> <br><br> </div>
<div> <b><font color="#2089a4">DESAFIAR</font></b> <br>al joven christiano a una entrega total a Dios y a crecer en su relación con El.<br><br> </div>
<div> <b><font color="#2089a4">PROVEERLE</font></b> <br> herramientas para que descubra sus dones y talentos.<br><br> </div>
<div> <b><font color="#2089a4">MOTIVARLO</font></b> <br> a un servicio comprometido en su iglesia local y movilizarlo a las misiones mundiales.<br> </div>
</p>
</div>
However, even if i change the size of my image, it is always above the text... why?
Finally i used the template "initializr" (see google), because it makes all responsive too, which i needed! thank you all anyway!
you might try adding the position property to the image
so, in this case,
image{position:fixed , absolute , relative; top:50%; left:50%;}
or this may work as well:
<div>
<image></image>
<p></p>
</div>
A commenter asked that I work with your code only. So, here's a solution using your code, to make the 2 divs sit next to each other.
<div style="float: left; width: 49%;">
<p><img alt="Cool" src="http://placehold.it/350x150" height="50%" width="50%" /></p>
</div>
<div style="float: right; width: 49%;">
<p class="text">
<div> <font color="#d54646"><b>MOVIDA</b> es un ministerio christiano, latino, internacional <br> e interdenominacional con el propósito de: </font> <br><br> </div>
<div> <b><font color="#2089a4">DESAFIAR</font></b> <br>al joven christiano a una entrega total a Dios y a crecer en su relación con El.<br><br> </div>
<div> <b><font color="#2089a4">PROVEERLE</font></b> <br> herramientas para que descubra sus dones y talentos.<br><br> </div>
<div> <b><font color="#2089a4">MOTIVARLO</font></b> <br> a un servicio comprometido en su iglesia local y movilizarlo a las misiones mundiales.<br> </div>
</p>
</div>
EDITED
Below I've posted code that in my mind is better formatted for your solution. Just wanted to offer up some alternatives.
<style type="text/css">
.left {
float: left;
width: 50%;
height: 50%;
}
.left img {
width: 100%;
height: 100%;
}
.right {
float: right;
}
.movida strong {
color: #d54646;
}
.common strong {
color: #2089a4;
}
.text strong {
display: block;
font-weight: bold;
}
</style>
<div class="left">
<p><img src="CIMA/CimaMetanoia.png" alt="Cool" /></p>
</div>
<div class="right">
<p class="text">
<div><span class="movida"><strong>MOVIDA</strong>es un ministerio christiano, latino, internacional e interdenominacional con el propósito de:</span></div>
<div><span class="common"><strong>DESAFIAR</strong>al joven christiano a una entrega total a Dios y a crecer en su relación con El.</span></div>
<div><span class="common"><strong>PROVEERLE</strong>herramientas para que descubra sus dones y talentos.</span></div>
<div><span class="common"><strong>MOTIVARLO</strong>a un servicio comprometido en su iglesia local y movilizarlo a las misiones mundiales.</span></div>
</p>
</div>
The text is pushed below the image because the combined width of the two container divs is wider than the page, so it pushes the second div below the first one:
<div style="display:inline-block;vertical-align:bottom;width:200px;">
http://jsfiddle.net/3Luby/
I've been trying for quite a while to achieve the effect of having the background of a text block to be blurred, to be able to have more readability on the text on top of the pictures.
But I keep getting both the background and text blurred. Now this has to be inline css since I have to put it in each entry.
This is what I'm trying
<div style= "background:white; background:rgba(255,255,255,0.5); filter:blur(4px); -o-filter:blur(4px); -ms-filter:blur(4px); -moz-filter:blur(4px); -webkit-filter:blur(4px); z-index: -1; padding: 5px;">
<p style= "z-index: 1;">
Desde hace 17 años Tybso se mantiene fiel a la filosofía de crear piezas únicas hechas 100% a mano pensadas siempre como ese objeto que es capaz de unir y resaltar el modo en que la gente come, vive y celebra alrededor de la comida y la buena cocina!
</p>
</div>
This is the link to see what's happening.
I agree with #Dryden Long, you should try to avoid long styles like this. However, you also have styled the <div> whereas I would recommend you style the <p>. Like:
<div>
<h1>This is not blurry</h1>
<p style= "background:white; background:rgba(255,255,255,0.5); filter:blur(4px); -o-filter:blur(4px); -ms-filter:blur(4px); -moz-filter:blur(4px); -webkit-filter:blur(4px); z-index: -1; padding: 5px;z-index: 1;">
Desde hace 17 años Tybso se mantiene fiel a la filosofía de crear piezas únicas hechas 100% a mano pensadas siempre como ese objeto que es capaz de unir y resaltar el modo en que la gente come, vive y celebra alrededor de la comida y la buena cocina!
</p>
</div>
Here is a fiddle: http://jsfiddle.net/sablefoste/JaazU/1/
Filter operates over a whole div, not just the background.
Try adding this
<p style = "filter:-; -o-filter:-; -ms-filter:-; -moz-filter:-; -webkit-filter:-;">
it worked on this JSFiddle
modifying sable foste's code to make the example jsfiddle, but all you need to do is have two divs, 1 with a blur background and 1 that is normal, and position the normal one over the blur.
http://jsfiddle.net/pW83w/
.blur {background:#e5ffcc; background:rgba(229,255,204,0.5); filter:blur(4px); -o-filter:blur(4px); -ms-filter:blur(4px); -moz-filter:blur(4px); -webkit-filter:blur(4px); z-index: -1; padding: 5px;z-index: 1; height: 5em; width: 20em; position: absolute;}
.noBlur {
font-weight: bold;
z-index: 5;
}