How do I to adjust the identation [closed] - html

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.

Related

How to adjust font-size of paragraph to fill the item height inside a flexbox container?

I'm creating a flexbox container with several items that contain text but not all texts have same lenght. I want to resize automatically the font size of text for fill the height of every flexbox item.
I have tried to set font-size with vh and another units and tried the js plugin FitText but it make all texts bigger.
Here is my code:
<div style="display:flex;flex-wrap:wrap;justify-content:space-between">
<blockquote class="articulo">
<p>Aprendizaje y práctica de la conciencia plena en estudiantes de bachillerato para potenciar la relajación y la autoeficacia en el rendimiento escolar</p>
<small><cite">universitas psychologica</cite></small>
</blockquote>
<blockquote class="articulo">
<p>Prevalencia de la depresión en España: Análisis de los últimos 15 años.</p>
<small><cite">universitas psychologica</cite></small>
</blockquote>
<blockquote class="articulo">
<p>Instrumentos para la evaluación de la sobrecarga del cuidador familiar de personas con demencia.</p>
<small><cite>universitas psychologica</cite></small>
</blockquote>
<blockquote class="articulo">
<p>Impulsividad y consumo de alcohol y tabaco en adolescentes.</p>
<small><cite>universitas psychologica</cite></small>
</blockquote>
</div>
CSS:
.articulo{
width:30%;
margin-bottom:20px;
border-left:3px solid #92c500;
}
.articulo cite{
text-transform: uppercase;
}
This is what I have:
and something like this is what I want:
This post gives quite a few answers, in terms of plugins and others:
Font scaling based on width of container
you'll have to make sure whatever you apply changes font size in regards to height and not width!
And I think using SVG as shown by Danto like this would work for your case:
<div style="height: 60px;">
<svg width="100%" height="100%" viewBox="0 -200 1000 300"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<text font-size="300" fill="black">Text</text>
</svg>
</div>
How about set font size 16px as default then use JavaScript or jquery and get the text length ,then check if length is < (num),set 18px font for example!

Center vertically an element

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

Font size increases significantly on android's chrome?

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!

How To Use CSS To Add Multiple Fonts In One Paragraph?

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

element will not display at 100% height

On the following webpage http://rocoru.com/web/course.html on line 91 the following HTML
<li><strong>Description</strong></li>
doesn't display at 100% height with the following CSS applied to it:
li strong {
width: 35%;
float: left;
height: 100%;
display: block;
}
What are potential reasons why this element would not equal the height of the < li> tag with the CSS shown above applied to it?
The Problem is in
<div>Il y a des petites fees au creux de ma main et qui prennent le the dans un jardin. Il y a des petites fees au creux de ma main et qui prennent le the dans un jardin</div>
You Used to much text..
try changing it to
<div> test text </div> and see the difference :)
hope it helps