I have currently got a school project where we need to make a website, just for fun tho! Anyways I have made a website with max-width, it works pretty good! only when the screen is small my buttons go over my image. Does anyone have a solution to this?
https://jsfiddle.net/fvwk2zr9/
#media screen and (max-width: 600px){
.float-left {float: none;}
Coen
You can drop down the content below the nav by first creating a new div to group the content outside of the div, with the class name "container" (This is a common web development practice):
<div class="container">
<div>
<img class="banner" src="http://i184.photobucket.com/albums/x286/tkReaper/ReaperBanner.jpg"/>
</div>
<div class="clearfix text-border">
<p><img class="img-text" src="stadenesch.jpg"/>Hoi! Leuk dat je langskomt bij Stad & Esch web oefeningen! Stad & Esch staat voor maatwerk-onderwijs. Zeker bij informatica worden de lessen al in grote mate afgestemd op de persoonlijke voorkeuren van de leerlingen. Er is voor ieder wat wils. Met deze teksten gaan we de website volstoppen om iets te zien van de mogelijkheden van CSS in combinatie met HTML bestanden </p>
</div>
</div>
Then add the new class "container" to your "#media screen and (max-width: 600px)" in the CSS, along with the attribute "margin-top" (220px from the top seemed to give the result you're after):
#media screen and (max-width: 600px){
.float-left {float: none;}
.container {margin-top: 220px}
}
NOTE: This is a quick, more static way of doing what you're after, if you add more items to your navigation bar, you'll need to increase the number on "margin-top"
Related
EDIT: Solved it. I had to change from the tag html to body { background. Thank you for your help everyone
I've searched on here and on google but I only get the opacity example, if I use opacity 0 then the text disappears too.
I have a html background meaning the complete page and in the code I've placed a div with a h1 and p tag with some text and then a white box-like background around the div of the text appears and I can't remove it.
<div class="container">
<div class="header-pris">
<h1>Pris alternativ:</h1>
<p>Skulle du vilja pröva enstaka timmar eller kanske tom mer timmar än vad som anges nedan så går det självklart också att annordna, kontakta oss direkt på
info#mail.se</p>
</div>
</div>
.header-pris {
text-align:center;
background-color:none;
}
tried with none as color but that doesn't do it so I don't know where I'm doing wrong or what the correct command should be to have no background on the div with the text so that you can see the image background
I don't think it's background-color:none; a valid property. Try using
background-color: transparent;
Text doesnt have a default background-color, it might be being set somewhere else in your CSS, use a property inspector in a browser to check which styles are applied
body {
background-image: url('http://www.pets4homes.co.uk/images/articles/1111/large/feline-influenza-all-about-cat-flu-5239fffd61ddf.jpg');
}
.header-pris,.header-pris-2 {
text-align:center;
}
.header-pris-2 p {
background-color: white;
}
<body>
<div class="container">
<div class="header-pris">
<h1>Pris alternativ:</h1>
<p>Skulle du vilja pröva enstaka timmar eller kanske tom mer timmar än vad som anges nedan så går det självklart också att annordna, kontakta oss direkt på
info#mail.se</p>
</div>
<div class="header-pris-2">
<h1>Pris alternativ:</h1>
<p>Skulle du vilja pröva enstaka timmar eller kanske tom mer timmar än vad som anges nedan så går det självklart också att annordna, kontakta oss direkt på
info#mail.se</p>
</div>
</div>
</body>
Just because this is another way of doing it.
You can use background-color: rgba(0,0,0,0);
The a is for alpha, it sets the opacity.
But the background-color: transparent; is the way to go.
Don't worry Nalin, I upvoted your answer since it is more correct :)
Nalin is correct, background-color: none is not valid. You also need the closing curly brace.
.header-pris {
text-align:center;
background-color: none; /* W3 will display error */
}
.header-pris {
text-align:center;
background-color: transparent; /* Use this instead */
}
Like Nalin said, I think you should do background-color:transparent;.
I just get stucked of how to center vertically an element.
<div class="wpb_wrapper">
<article class="callout"><a class="callurl" href="#">NOS SUCCESS STORIES</a>
<h3>Développement IT</h3><p></p>
<p>La transformation digitale, c’est avant tout un nouveau rapport d’opportunités d’innovations immense, dynamisé par :</p>
<p>- L’adhésion accélérée du grand public à de nouveaux usages.</p>
<p>- La collecte et le traitement de données toujours plus nombreuses.</p>
<p>- Le partage de la connaissance et l'Open Innovation IT.</p>
<p></p></article>
</div>
The code is in: http://jsfiddle.net/lzyphil/2bq7zqvf/
In fact,this part of code is generated by a wordpress plugin Webnus Callout,and I'm trying to modify the css in the hope that 'NOS SUCESS STORIES' sits vertically in the middle of <article>
Anyone get some ideas? Solution would be appreciated! Thanks
You can place the callout button absolutely positioned with respect to the relative parent container. It overlaps when mobile size browser breakpoint is reached. But you can modify it using media query with the desired position.
Output:
.callout a.callurl {
position: absolute;
right: 5%;
top: 40%;
}
JSfiddle
I've almost finished a website, but encounter a huge issue with chrome on android. Stock browsers work fine, but chrome is messing with my text size. My h4 should be 24px, the paragraph 14px. Though, on chrome mobile the text is increased many steps.
I encountered giving a specified height for the results in the original text size (as in the first section where the id="fotostyle" has a height of like 500px).
Is there another way around this problem? Don't want to give ALL my sections on the website fixed heights ;).
Thanks for your ideas! :D
Menno
Image to show the wrong result <<
<section class="box welcomeBox" id="fotoStyle">
<h4> Fotografiestijlen </h4>
<p class="contentBlockSubTitle"> Diverse fotografiestijlen kunnen gebruikt worden. De meeste ouders stellen portretfoto's op prijs, omdat ze deze meestal niet zelf kunnen maken. De foto's in creatieve stijl worden meestal zelf gemaakt. De keuze wordt dan ook altijd in overleg met de schoolleiding gemaakt.</p>
<div> ...............
<section class="box accordeonBox">
<h4> Afhandeling foto's </h4>
<p class="contentBlockSubTitle"> Wij bieden 4 mogelijkheden om een fotopakket te bestellen. Neem voor vragen graag contact met ons op.</p>
<div class="accordion"> .........
.box {
background-color: white;
padding: 50px;
border-radius: 3px;
box-sizing: border-box;
-moz-box-sizing: border-box;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.27);
}
.welcomeBox {
width: 100%;
padding-top: 26px;
margin-top: 36px;
}
Hmm interesting, looking at your html the only difference between the first (OK) and second (NO) section seems the id="fotoStyle" part. Might this effect the OK paragraph?
Try looking what happens if you add that ID to the second as well section and you might find the source of the smaller text.
Comment if you still havent found the problem!
I'm trying to get a title and text into one paragraph. The title, however, should have another font than the text. I could get it to work using a lot of <div>'s but it's hard to do it that way. I'm looking to do it without a lot of <div>'s but i figured it might be impossible without any <div>'s. Here's my code:
<div class="blue">
<p class="font2">
Bits
</p>
<br>
<p class="font1">
Een bit is een kleine schakelaar die open of gesloten is.
De bit krijgt de waarde 1 of 0 als de schakelaar open of gesloten is.
De enen en nullen kunnen worden gezien als ja en nee of aan en uit.
Computers gebruiken deze waarden om informatie op te slaan en te lezen.
</p>
</div>
Thanks for your help!
I'd also like to ask another question:
#menu1 a {display: block; background-color: #0066FF; text-decoration: none; font-family: calibri; font-size: 20px; color: #FFFFFF; padding: 5px 5px;}
#menu1 a:hover {background-color: #0088FF}
#menu1 li {display: inline-block;}
#menu1 ul {list-style: none; text-align: center; margin: 0 auto; padding:0px;}
Here's my code. I'm trying to get it all under one #menu1 Because i'm working with multiple menu's and i don't want to lose my overview.
Thanks for your help!
Try this simple method using span
best way to add class to text is using <span> and to change style use font-family:
.bold {
font-family: cursive
}
.italic {
font-family: fantasy
}
.underline {
font-family: monospace
}
.italic {
font-family: serif
}
<div class="blue">
<p class="font2">
Bits
</p>
<br>
<p class="font1">
<span class="bold">Een bit is een kleine schakelaar die open of gesloten is.</span>
<span class="italic">De bit krijgt de waarde 1 of 0 als de schakelaar open of gesloten is.</span>
<span class="underline">De enen en nullen kunnen worden gezien als ja en nee of aan en uit.</span>
<span class="boldit">Computers gebruiken deze waarden om informatie op te slaan en te lezen.</span>
</p>
</div>
You'll probably have much better luck with slightly-reworked HTML, to improve the structure. For example:
<h2>Bits</h2>
<p>
Een bit is een kleine schakelaar die open of gesloten is.
De bit krijgt de waarde 1 of 0 als de schakelaar open of gesloten is.
De enen en nullen kunnen worden gezien als ja en nee of aan en uit.
Computers gebruiken deze waarden om informatie op te slaan en te lezen.
</p>
The h2 should be at whatever level is appropriate.
Now, you can style that as you wish by targetting the h2 and the p. If you want them grouped, for semantic reasons, you can wrap both in a section element. Otherwise, if you wish to style each separately from other h2 / p elements in your document, you can apply a class to each.
Now, what styles do you wish to apply to each element? As an example, you can start with:
h2 { font-family: sans-serif; }
p { font-family: serif; }
Based on another answer, and the title of this question, would it be correct to say you want each sentence in the paragraph to have potentially different styles?
Just wrap your text in a span and add a class it's inline by default and won't break your lines:
<p>some text <span class="font1">with a headline</span> and some other text in the same paragraph with <span class="font2">another headline</span></p>
I don't know if you have your styles in an external stylesheet, at this point I'm assuming not, so in you head tag put:
<style>
.font1{
font-family:arial /* put whatever font you want here */
}
.font2{
font-family:helvetica /* put whatever font you want here */
}
</style>
you should externalize your styles if you aren't, and I'd look into using h1, h2, h3 tags etc instead of p elements for titles
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
How to ensure that the text does not exceed the gray border, and there is no scroll bar? I think that the problem is comming from the width of <td class="message">.
Edit : The bottom-border is already the border of <td class="message"> to show its width.
Here is the fiddle : http://jsfiddle.net/eGVZx/3/
HTML
<div class="liste_posts">
<table>
<tr>
<td class="message">
<div class="topic_div"><p>Si vous êtes sur cette page, c'est parce que vous avez décidé de laisser tomber phpbb, ou autre, pour vous lancer dans l'aventure qu'est la création d'un forum. Et ça tombe bien, parce que justement, ici on va voir comment faire ça Smiley. Il faut, avant de commencer, que vous sachiez que je vais montrer comment réaliser une base que vous pourrez ensuite faire évoluer comme bon vous semblera.</p></div>
</td>
</tr>
</table>
</div>
CSS
.message{
background-color: rgb(244, 238, 250);
}
.topic_div p {
word-break: break-all;
}
Thanks in advance.
If you want to indent the first line use the css text-indent. If you want to indent all lines use padding-left for a left indent.
As far as your text flowing out of your <td> you need to add a max-width to your <td> or the div.topic_div or just a static width.
////EDIT////
http://jsfiddle.net/eGVZx/6/
I may not be understanding your requirements; however, here is something which might be similar to what you are looking for:
http://jsfiddle.net/eGVZx/8/
.message{
background-color: rgb(244, 238, 250);
}
.topic_div p {
word-break: break-all;
width: 80%;
padding-right: 20%;
}
This would allow for the "gray" section to cover the other 20% where the text is not. Needless to say, you can adjust the percentage indent as necessary to create enough room for the text area and gray area, which would sit over top.
Please provide more information if necessary.
Hope this helps at all.