Font Size In Html Code - Stack Overflow

Sorry, we no longer support your browser Please upgrade to Microsoft Edge, Google Chrome, or Firefox. Learn more about our browser support. Just browsing Stack Overflow? Help us improve your experience. Sign up for research
    1. Home
    2. Questions
    3. Tags
    4. Users
    5. Companies
    6. Labs
    7. Jobs
    8. Discussions
    9. Collectives
    10. Communities for your favorite technologies. Explore all Collectives

  1. Teams

    Ask questions, find answers and collaborate at work with Stack Overflow for Teams.

    Try Teams for free Explore Teams
  2. Teams
  3. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Get early access and see previews of new features.

Learn more about Labs font size in html code Ask Question Asked 14 years, 1 month ago Modified 3 years, 6 months ago Viewed 161k times 9 <html> <tr> <td style="padding-left: 5px;padding-bottom:3px; font size="35;""> <b>Datum:</b><br/> November 2010 </td> </html>

is my code correct? i would like to increase the font of the first line. Not sure if i have to put 2 "'s here. and it seems it didn't work.

Share Improve this question Follow asked Oct 7, 2010 at 12:16 tintincutes's user avatar tintincutestintincutes 5,76825 gold badges69 silver badges87 bronze badges 5
  • @RoToRa:I've learned them many years ago & I forgot... it's like when I learned HTML & also forgot..if you don't feel helping here, it's ok. Then don't reply. I mean, I thought this is what the forum is for, to help not only the newbies but also sharing ideas with each other. – tintincutes Commented Oct 7, 2010 at 13:22
  • Bookmark this site: w3schools.com It is a good reference for CSS, and other stuff as well. – DwB Commented Oct 7, 2010 at 13:40
  • No, w3schools.com is full of errors and half truths. The specifications make a much better reference than w3schools. – Quentin Commented Oct 7, 2010 at 16:13
  • — recommending a decent tutorial is helping. (It isn't answering the question, but RoToRa made a comment, not an answer). – Quentin Commented Oct 7, 2010 at 16:14
  • Jeez! Shed the attitude, guys ! World is made up of all kinds of people !!! – Do Will Commented Apr 22, 2014 at 14:28
Add a comment |

9 Answers 9

Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 17

Try this:

<html> <table> <tr> <td style="padding-left: 5px; padding-bottom: 3px;"> <strong style="font-size: 35px;">Datum:</strong><br /> November 2010 </td> </tr> </table> </html>

Notice that I also included the table-tag, which you seem to have forgotten. This has to be included if you want this to appear as a table.

Share Improve this answer Follow edited Oct 7, 2010 at 12:36 answered Oct 7, 2010 at 12:23 Good Samaritan's user avatar Good SamaritanGood Samaritan 7061 gold badge7 silver badges21 bronze badges 8
  • this code is also similar with others but this one it's working don't understand why – tintincutes Commented Oct 7, 2010 at 12:25
  • It is because of the table-tag..:) – Good Samaritan Commented Oct 7, 2010 at 12:26
  • what do you mean "table-tag"? – tintincutes Commented Oct 7, 2010 at 12:33
  • i just wanted to have the font size change in Datum, if i do this the "November" also follows – tintincutes Commented Oct 7, 2010 at 12:34
  • Oh, I must have misread your question, I have now updated my answer. – Good Samaritan Commented Oct 7, 2010 at 12:37
| Show 3 more comments 10 font-size:35px;

So like this:

<html> <table> <tr> <td style="padding-left:5px;padding-bottom:3px;"> <strong style="font-size:35px;">Datum:</strong> <br/> November 2010 </td> </tr> </table> </html>

Although inline styles are a bad practice and you should class things. Also you should use a <strong></strong> tag instead of <b></b>

Share Improve this answer Follow edited May 14, 2021 at 15:39 answered Oct 7, 2010 at 12:19 jimplode's user avatar jimplodejimplode 3,5023 gold badges26 silver badges43 bronze badges 6
  • Try that.... I missread your post, now the first line will be bigger than the second. – jimplode Commented Oct 7, 2010 at 12:23
  • 1 It is worth pointing out the issues involved with using pixels for font size ( css-discuss.incutio.com/wiki/Using_Pixels ) and advising to use style sheets instead of style attributes. The advice for <strong> Vs <b> doesn't always hold, sometimes font-weight is a better choice than <strong> – Quentin Commented Oct 7, 2010 at 12:24
  • @Christ Shouts: you left </tr> from the code..will try this one – tintincutes Commented Oct 7, 2010 at 12:43
  • @tintincute - That same </tr> was missing from your original post. – Matt Commented Oct 7, 2010 at 12:44
  • @David Dorward: Using <strong> is still advisable over <b> for things like screen readers ect. And yes, controlling the amount of boldness should be done through styling. – jimplode Commented Oct 7, 2010 at 14:10
| Show 1 more comment 3

you dont need those quotes

<td style="padding-left: 5px;padding-bottom:3px; font-size: 35px;"> <b>Datum:</b><br/> November 2010 </td> Share Improve this answer Follow answered Oct 7, 2010 at 12:20 jknair's user avatar jknairjknair 4,7541 gold badge19 silver badges20 bronze badges 3
  • @tintincute - this should have worked. What exactly is it doing? – Spudley Commented Oct 7, 2010 at 12:25
  • @tintincute : this should have worked what kind do you get any kind of change ??? – jknair Commented Oct 7, 2010 at 12:27
  • i copied it here and then paste in my code and run into my browser – tintincutes Commented Oct 7, 2010 at 12:39
Add a comment | 1

There are a couple of answers posted here that will give you the text effects you want, but...

The thing about tables is that they are organized collections of labels and data. Having both a label ("Datum") and the value that it labels in the same cell is oh so very wrong. The label should be in a <th> element, with the value in a <td> either in the same row or the same column (depending on the data arrangement you are trying to achieve). You can have <th> elements running either vertically or horizontally or both, but if you don't have heading cells (which is what <th> means), you don't have a table, you just have a meaningless grid of text. It would be preferable, too, to have a <caption> element to label the table as a whole (you don't have to display the caption, but it should be there for accessibility) and have a summary="blah blah blah" attribute in the table tag, again for accessibility. So your HTML should probably look a lot more like this:

<html> <head> <title>Test page with Table<title> <style type="text/css"> th { font-size: 35px; font-weight: bold; padding-left: 5px; padding-bottom: 3px; } </style> </head> <body> <table id="table_1" summary="This table has both labels and values"> <caption>Table of Stuff</caption> <tr> <th>Datum</th> <td>November 2010</td> </tr> </table> </body> </html>

That may not be exactly what you want -- it's hard to tell whether November 2010 is a data point or a label from what you've posted, and "Datum" isn't a helpful label in any case. Play with it a bit, but make sure that when your table is finished it actually has some kind of semantic meaning. If it's not a real table of data, then don't use a <table> to lay it out.

Share Improve this answer Follow answered Oct 7, 2010 at 13:49 Stan Rogers's user avatar Stan RogersStan Rogers 2,17011 silver badges9 bronze badges Add a comment | 0

Don't need to quote css attributes and you should specify an unit. (You should use an external css file too..!)

Share Improve this answer Follow answered Oct 7, 2010 at 12:19 MatTheCat's user avatar MatTheCatMatTheCat 18.7k6 gold badges58 silver badges70 bronze badges Add a comment | 0 <html> <table> <tr> <td style="padding-left: 5px;padding-bottom:3px; font-size:35px;"> <b>Datum:</b><br/> November 2010 </td> </table> </html> Share Improve this answer Follow answered Oct 7, 2010 at 12:23 TheFitGeekGirl's user avatar TheFitGeekGirlTheFitGeekGirl 1,2531 gold badge12 silver badges17 bronze badges Add a comment | 0

just write the css attributes in a proper manner i.e:

font-size:35px; Share Improve this answer Follow edited Aug 20, 2012 at 6:33 Rostyslav Dzinko's user avatar Rostyslav Dzinko 40.7k5 gold badges53 silver badges65 bronze badges answered Oct 7, 2010 at 12:27 Prateek's user avatar PrateekPrateek 1,55813 silver badges23 bronze badges Add a comment | -1

I suggest you use CSS instead, seems like you're going to repeat those lines later on. But to answer your question:

<html> <head> <style type="text/css"> td.randname { padding-left: 5px; padding-bottom:3px; font-size:35px; } </style> </head> <body> <table> <tr> <td class="randname"> <b>Datum:</b><br/> November 2010 </td></tr> </table> </body> </html> Share Improve this answer Follow edited Oct 7, 2010 at 12:30 answered Oct 7, 2010 at 12:22 Ruel's user avatar RuelRuel 15.7k7 gold badges40 silver badges49 bronze badges 0 Add a comment | -2

The correct CSS for setting font-size is "font-size: 35px". I.e.:

<td style="padding-left: 5px; padding-bottom:3px; font size: 35px;">

Note that this sets the font size in pixels. You can also set it in *em*s or percentage. Learn more about fonts in CSS here: http://www.w3schools.com/css/css_font.asp

Share Improve this answer Follow edited Oct 7, 2010 at 13:23 answered Oct 7, 2010 at 12:21 Vetle's user avatar VetleVetle 3,3972 gold badges28 silver badges28 bronze badges 0 Add a comment |

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid …

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Draft saved Draft discarded

Sign up or log in

Sign up using Google Sign up using Email and Password Submit

Post as a guest

Name Email

Required, but never shown

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.

  • The Overflow Blog
  • Your docs are your infrastructure
  • Featured on Meta
  • More network sites to see advertising test [updated with phase 2]
  • We’re (finally!) going to the cloud!
  • Call for testers for an early access release of a Stack Overflow extension...
2 HTML: Font size is too big - why? 1 How to precisely control font-size on html page? 4 CSS Font Size Specifics 1 How to define CSS font size within font tags? 19 How to change font size in html? 0 Font size in html using css 0 Font Size Problems 1 Changing HTML Font Size 0 Javascript/HTML: Need to change font size 3 Font size CSS issue

Hot Network Questions

  • Is this tv show example of hearsay actually hearsay?
  • How to generate conditions before evaluating integral
  • How do I add a trusted check constraint quickly
  • Can I make a pipe save data to disk instead of blocking until the reader can continue?
  • Why do some claim that the law of non-contradiction is non-trivially unprovable?
  • Is my "escaping" wrong - or is it something else?
  • Beta sensitivity of the collector current
  • Can you make 5 x 3 “magic” rectangles?
  • Does midnight (00:00) mean the time at the end of day depending on the locale for cron?
  • Frogs on lily pads want to make a party
  • How to sample a single point from a volume
  • Student is almost always late, and expects me to re-explain everything he missed
  • An idiom similar to 'canary' or 'litmus test' that expresses the trend or direction a thing is pointed
  • Finding the minimum through a chain of inequalities
  • What kind of solvent is effective for removing roofing tar from shoes?
  • See me Once, See me Twice #16
  • Need help to prove the summation of series. It works in programming, but I don't know how to prove.
  • Can I freely choose the spellcasting ability of Magic initiate, or is it tied to the spell list that I chose?
  • Can you please advise on kerning?
  • Configure Linux to regularly sync cached data to disk
  • Does synonymy seep down to the fragments of theories?
  • Schrödinger's cat ++
  • Did renaissance actors learn their parts by heart?
  • Is William Dembski’s argument for Intelligent Design self undermining?
more hot questions Question feed Subscribe to RSS Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-html

Từ khóa » Html Td Style Font Size