In article <t0k9ui$vi1$1@dont-email.me>, dale@dalekelly.org says...
I know how to do alignment to the center, right, and left.
how do I do tabs and indentation?
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
Further to my previous response in another thread:
Randomly asking questions is a very inefficient way to learn how to build web pages (for everyone). You need to read up on HTML and CSS. Your question isn't even at a decent beginner level - it's what your Gran might ask.
A browser lays out HTML according to CSS stylesheets, including a default one built-in. That will set, for example, the 'margin' and 'padding' of various elements, unless superseded by a custom stylesheet (which is usual).
Linkedin has very good tutorial videos for a monthly fee - formerly the excellent Lynda.com. You may also find good stuff on YouTube.
I know how to do alignment to the center, right, and left.
how do I do tabs and indentation?
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
In article <MPG.3c97e3f5f6fe31e69899b3@news.eternal-september.org>, thiswillbounceback@you.com says...
In article <t0k9ui$vi1$1@dont-email.me>, dale@dalekelly.org says...
I know how to do alignment to the center, right, and left.
how do I do tabs and indentation?
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
Further to my previous response in another thread:
Randomly asking questions is a very inefficient way to learn how to build web
pages (for everyone). You need to read up on HTML and CSS. Your question isn't even at a decent beginner level - it's what your Gran might ask.
A browser lays out HTML according to CSS stylesheets, including a default one
built-in. That will set, for example, the 'margin' and 'padding' of various
elements, unless superseded by a custom stylesheet (which is usual).
Linkedin has very good tutorial videos for a monthly fee - formerly the excellent Lynda.com. You may also find good stuff on YouTube.
Try this:
https://www.w3schools.com/
I know how to do alignment to the center, right, and left.
how do I do tabs and indentation?
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
(Unfortunately, I cannot think of any specific recommended
books now.)
Try this:
https://www.w3schools.com/
ram@zedat.fu-berlin.de (Stefan Ram) writes:
(Unfortunately, I cannot think of any specific recommended
books now.)
They may be a bit dated today, but books I liked at one point include:
Learning Web Design, Jennifer Robbins
CSS Pocket Reference, Eric Meyer
HTML5 for Masterminds, Juan Gauchat
Learning JavaScript, Tim Wright
Modern JavaScript, Larry Ullman
.
Maybe one could use pseudo class selectors (like ":checked")
to implement tabs with CSS only.
Don't want JavaScript or cookies.
how do I do tabs and indentation?
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
ram@zedat.fu-berlin.de (Stefan Ram) writes:
Maybe one could use pseudo class selectors (like ":checked")
to implement tabs with CSS only.
Maybe something like the following?
<!DOCTYPE html><html>
<head><meta charset="UTF-8" /><title></title><style type="text/css"> label { padding: 5px 20px 5px 20px; border: 1px solid #CCC }
input, p { display: none; }
input:checked + p { display: block; }
</style></head><body>
<label for='button0'>0</label>
<label for='button1'>1</label>
<label for='button2'>2</label>
<input id='button0' name='radio' type='radio' />
<input id='button1' name='radio' type='radio' /><p>paragraph 1</p>
<input id='button2' name='radio' type='radio' /><p>paragraph 2</p>
</body></html>
Dale wrote:
how do I do tabs and indentation?
No idea. You need to explain what you want, instead of mentioning (very vaguely) assumed solutions to unspecified problems. In particular, “tab” can mean a dozen things, or more.
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
This was an easy one. The spacing is caused by default vertical margins
for elements. Put this into your <head>:
<style>
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
h1 { margin-bottom: 0: }
Put this into your <head>:
<style>
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
<style>Maybe you wanted to type a semicolon instead of a colon
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
in both cases.
https://www.w3 schools.com/
I know how to do alignment to the center, right, and left.
how do I do tabs and indentation?
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
In message <MPG.3c97eabcecb239a99899b4@news.eternal-september.org> Philip Herlihy <thiswillbounceback@you.com> wrote:
https://www.w3 schools.com/
Let's not recommend w3 schools, it is a mess.
"Jukka K. Korpela" <jukkakk@gmail.com> writes:
Put this into your <head>:
Nice pun!
<style>
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
Maybe you wanted to type a semicolon instead of a colon
in both cases.
On 3/13/2022 12:28 AM, Dale wrote:
I know how to do alignment to the center, right, and left.
how do I do tabs and indentation?
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
To indent the first line of a paragraph, see <https://www.w3.org/TR/CSS22/selector.html#first-line-pseudo>.
On 3/13/2022 10:43 AM, Jukka K. Korpela wrote:
Dale wrote:
how do I do tabs and indentation?
No idea. You need to explain what you want, instead of mentioning
(very vaguely) assumed solutions to unspecified problems. In
particular, “tab” can mean a dozen things, or more.
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
This was an easy one. The spacing is caused by default vertical
margins for elements. Put this into your <head>:
<style>
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
still has a line between them
<!DOCTYPE html>
<html>
<head>
<style>
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
</head>
<body>
<h1>test</h1>
<p>test</p>
</body>
</html>
On 3/13/2022 1:09 PM, Dale wrote:
On 3/13/2022 10:43 AM, Jukka K. Korpela wrote:
Dale wrote:
how do I do tabs and indentation?
No idea. You need to explain what you want, instead of mentioning
(very vaguely) assumed solutions to unspecified problems. In
particular, “tab” can mean a dozen things, or more.
also, when I do something like this
<h1>Header</h1>
<p>Paragraph</p>
I get this ...
Header
Paragraph
notice the space between Header and Paragraph without <br>
how can I get rid of that space?
This was an easy one. The spacing is caused by default vertical
margins for elements. Put this into your <head>:
<style>
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
still has a line between them
<!DOCTYPE html>
<html>
<head>
<style>
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
</head>
<body>
<h1>test</h1>
<p>test</p>
</body>
</html>
Doesn't work with <h3>
<style>
h3 { margin-bottom: 0; }
h3 + p { margin-top: 0; }
</style>
To indent the first line of a paragraph, see https://www.w3.org/TR/CSS22/selector.html#first-line-pseudo
https://www.w3 schools.com/
Dale <dale@dalekelly.org> writes:
h1 { margin-bottom: 0: }
"0:" is not a valid value for "margin-bottom". Try "0ex".
ram@zedat.fu-berlin.de (Stefan Ram) writes:
Maybe one could use pseudo class selectors (like ":checked")
to implement tabs with CSS only.
Maybe something like the following?
<!DOCTYPE html><html>
<head><meta charset="UTF-8" /><title></title><style type="text/css"> label { padding: 5px 20px 5px 20px; border: 1px solid #CCC }
input, p { display: none; }
input:checked + p { display: block; }
</style></head><body>
<label for='button0'>0</label>
<label for='button1'>1</label>
<label for='button2'>2</label>
<input id='button0' name='radio' type='radio' />
<input id='button1' name='radio' type='radio' /><p>paragraph 1</p>
<input id='button2' name='radio' type='radio' /><p>paragraph 2</p>
</body></html>
In message <t0lhvb$nsf$1@dont-email.me> Dale <dale@dalekelly.org> wrote:
Now I am left to find out how to indent the <p> under the <h1>
h1 + p:first-line { text-indent; 5em;}
IIRC.
and add a style to make <p> larger on smart phones and tablets.
If you use em (as you should) you needn't do this.
Now I am left to find out how to indent the <p> under the <h1>
and add a style to make <p> larger on smart phones and tablets.
On 3/13/2022 8:41 PM, Lewis wrote:
In message <t0lhvb$nsf$1@dont-email.me> Dale <dale@dalekelly.org> wrote:
Now I am left to find out how to indent the <p> under the <h1>
h1 + p:first-line { text-indent; 5em;}
IIRC.
and add a style to make <p> larger on smart phones and tablets.
If you use em (as you should) you needn't do this.
https://www.w3schools.com/w3css/w3css_templates.asp
is this what you are referring to?
In message <MPG.3c97eabcecb239a99899b4@news.eternal-september.org> Philip Herlihy <thiswillbounceback@you.com> wrote:
https://www.w3 schools.com/
Let's not recommend w3 schools, it is a mess.
Stefan Ram wrote:
Yes, thanks for pointing this out. (Now, who invented a keyboard where >“,” and “.” are adjacent as well as “;” and “:”?)<style>Maybe you wanted to type a semicolon instead of a colon
h1 { margin-bottom: 0: }
h1 + p { margin-top: 0: }
</style>
in both cases.
characters like “.” and “,” adjacent? Regarding “:” and “;”, the US
"Jukka K. Korpela" <jukkakk@gmail.com> writes:- -
(Now, who invented a keyboard where
“,” and “.” are adjacent as well as “;” and “:”?)
I'm sure you realize this, but I'm just saying it for the
sake of other readers:
In CSS, the semicolon does /not/ terminate a declaration,
it /separates/ declarations within a ruleset.
ruleset : selector? '{' S* declaration? [ ';' S* declaration? ]* '}' S*;
Therefore, if a ruleset has just a single declaration,
no semicolon is required.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 374 |
Nodes: | 16 (2 / 14) |
Uptime: | 119:48:30 |
Calls: | 7,953 |
Calls today: | 4 |
Files: | 13,008 |
Messages: | 5,812,035 |