Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,194,594 members, 7,955,188 topics. Date: Saturday, 21 September 2024 at 07:03 PM

My First Css Quiz / Convert This Css Into Html! - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / My First Css Quiz / Convert This Css Into Html! (1309 Views)

How To Convert .pub Format File To .jpg? / Most Confusing And Simple Maths Quiz / How To: Create A Simple Hover Button With Html And Css (2) (3) (4)

(1) (Reply) (Go Down)

My First Css Quiz / Convert This Css Into Html! by Nobody: 4:40am On Apr 21, 2011
Now this is a rather simple quiz actually. This is a css class below

.myclass {font-size:18px;font-weight:400;line-height:21.6px}


Now i want to say <span class="myclass">This is a quiz and not an exam</span>

However, because i am writing a professional exam and i claimed to have mastered HTML,
so i was asked to rewrite the same thing in html and not use css at all - not even inline css,
and it must produce exactly the same effect as the class shown above. . . . .como? how?
will i solve this trivial problem?
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 8:59am On Apr 21, 2011
*dhtml:

Now this is a rather simple quiz actually. This is a css class below

.myclass {font-size:18px;font-weight:400;line-height:21.6px}


Now i want to say <span class="myclass">This is a quiz and not an exam</span>

However, because i am writing a professional exam and i claimed to have mastered HTML,
so i was asked to rewrite the same thing in html and not use css at all - not even inline css,
and it must produce exactly the same effect as the class shown above. . . . .como? how?
will i solve this trivial problem?



          <font face="whatever" size="18px">

                <b>This is a quiz and not an exam</b>

         </font>

note: I have decided to drop line-height as a way to do away  with redundancy since the content itself is short and not expected to take the next line. plus, "font-weight:400px" is as good as [b]bold[b]
Re: My First Css Quiz / Convert This Css Into Html! by Nobody: 11:46am On Apr 21, 2011
Ahem, that might do it. but i forgot, the font tag has been disabled from the browser also.
I think there is a particular html formatting tag that will give you exactly the same result as
that class. Just a single container formatting tag - definitely not paragraph.
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 11:59am On Apr 21, 2011
talking about <span>?
Re: My First Css Quiz / Convert This Css Into Html! by yawatide(f): 3:30pm On Apr 21, 2011
font hasn't been disabled. I happen to work with a guy who sent me a file recently with the bloody tag all over it. It is deprecated.

Back to the quiz:
The question is as clear as muddy water to me cool
Re: My First Css Quiz / Convert This Css Into Html! by Nobody: 6:28pm On Apr 21, 2011
.myclass {font-size:18px;font-weight:400;line-height:21.6px}


<span class="myclass">This is a quiz and not an exam</span>

Answer to quiz is

<h2>This is a quiz and not an exam</h2>

The html tag which gives all that effect is h2!

- hasta la vista
Re: My First Css Quiz / Convert This Css Into Html! by yawatide(f): 9:02pm On Apr 21, 2011
1) how many would know (or would care to know) that H2 has a font-size of 18px?
2) doesn't the ability to control behaviour via css nullify this?
Re: My First Css Quiz / Convert This Css Into Html! by Nobody: 9:15pm On Apr 21, 2011
Apologies, but i failed the quiz too. . . . .i will explain shortly. . .
Re: My First Css Quiz / Convert This Css Into Html! by Nobody: 9:22pm On Apr 21, 2011
*dhtml:

Apologies, but i failed the quiz too. . . . .i will explain shortly. . .
I forgot that a certain setting in my browser prevented my fonts from showing the right size.

But what the quiz is just trying to say is that ehm HTML Formatting Tags such as h1, h2, h3, h4, h5, h6 et al
all use CSS to render their effects.
yawa-ti-de:

1) how many would know (or would care to know) that H2 has a font-size of 18px?
2) doesn't the ability to control behaviour via css nullify this?

Let me show you an example of why you need to know such atimes.

How will you solve this problem?

<h2>Please <a href="www.nairaland.com">click here</a> to continue</h2>

Now, without even previewing that, you know that the link will not be the same size as the text, so what do you do?


[s]<h2>Please <a href="www.nairaland.com"><h2>click here</h2></a> to continue</h2>
[/s]
No way, you solve it easily by using the method i highlited at the begining.

To all, to find out the css attributes of the formating tag, create a blank webpage and use the formating tags there e.g

<h1>Header 1</h1>
<h2>Header 2</h2>
<h3>Header 3</h3>
<address>Address</address>


Then open the page in mozilla firefox, make sure you have your firebug / inspector. Then check the computed style.

h1 is something like font-size 32px and line height: 37px

There are times in everyday programming when you need to write css to override the default attributes of html tags.
So it is useful to know how these things work atimes. . . .
Re: My First Css Quiz / Convert This Css Into Html! by dhtml3(m): 9:33pm On Apr 21, 2011
My last post was swallowed by spam bot and it bounced me.

To find out the properties of the formating tag, please
use them in an html page with no styles, then use the mozilla
firebug to investigate checking the computed attributes.

There are times when you need to do something like this
[h1]Click on this link [a href='yahoo']yahoo dot com[/a] to continue[/h1]

And you want the link to have same attributes as that h1, are you going to use trial and error
to guess the size? just inspect them.

That is one instance, i will stop here before them bannnn me again for the gazillionth time. . .

It is sometimes a good idea to have backup accounts in case you get banned without warning!
Re: My First Css Quiz / Convert This Css Into Html! by monasor28(m): 9:37pm On Apr 21, 2011
First of all Nobody does inline styling any more, that is the reason CSS was  created to take care of design properties colors,hieght,transparency e.t.c

And html for structure, Any way your question is rather childish, serioulsly who's the slowpoke that set the question, excuse my language but i get upset when
anonymous people display *^$&* symptoms on public boards,

Inline styling as it called would be===

=====================================
<span style="font-size:18px;font-weight:400;line-height:21.6px"> blah blah blah </span>
======================================

DO you have any video tutorial on html5 and css3 --- i cant get my finger around it, through this lame text,
Re: My First Css Quiz / Convert This Css Into Html! by dhtml3(m): 10:04pm On Apr 21, 2011
@monasor28, you are correct about one thing though - this question is not for children really.
Re: My First Css Quiz / Convert This Css Into Html! by yawatide(f): 11:17pm On Apr 21, 2011
First of all Nobody does inline styling any more, that is the reason CSS was created to take care of design properties colors,hieght,transparency e.t.c

1) Actually, CSS was created to separate content from presentation. In order to do this, you can use one of 3 methods: inline, page level or stylesheets. inline is obviously bad because it adds unnecessary weight to the page and makes stuff hard to read and maintain and reuse

2) Are you sure "nobody does inline styling anymore"? Have you seen some of the sites posted here for review? This isn't to say that inline styling is bad in all circumstances but there are those who use it as a religion though, and that is bad.
Re: My First Css Quiz / Convert This Css Into Html! by monasor28(m): 4:00am On Apr 22, 2011
<address>Address</address>

@yewa-tide - i dont think mr dumbhtml knows what he is talking about,

@dhtml - the only way the <address> thing can work is if ; its a <div id="address"> with coresponding css or <div class="address"> with coresponding css

Html has no element <address>
Re: My First Css Quiz / Convert This Css Into Html! by yawatide(f): 4:54am On Apr 22, 2011
Html has no element <address>

Actually it does: http://www.w3.org/TR/html401/struct/global.html#h-7.5.6

Please note:
It may seem like I am hunting you down or trying to make you look bad. This is far from the case. I am doing what I am doing because there are newbies who will be reading this, and other, threads and I don't want them to be mislead. In the end, the integrity of this board is (hopefully) maintained.
Re: My First Css Quiz / Convert This Css Into Html! by dhtml3(m): 5:37am On Apr 22, 2011
Thanks yawatide. This guy has been trying to make me look bad since he got here, but he does not have the required
stuffs to do that. I dont need to consult internet or to consult books before making my posts - i dont tale small for this
business nah?

monasor28:

@yewa-tide - i dont think mr dumbhtml knows what he is talking about,

@dhtml - the only way the <address> thing can work is if ; its a <div id="address"> with coresponding css or <div class="address"> with coresponding css

Html has no element <address>
go and learn html, and then come back to talk to me. I am light years ahead of you in this.


I dont expect newbies to know things like this. But the main tags i am talking about here - in my quiz is the header tags.
That they have css stuffs attached to them. And there is still an address tag last time i heard.

Because some tags such as dd/dt/blockquote and many others are not commonly used like that does not mean they dont
exist.


As at the time i learnt html, there was an address tag. Maybe you are not aware.

But please, execute this in your browsers:

<address>My address is</address>
It works in browsers, and you can check this out - http://www.w3schools.com/tags/tag_address.asp
or just search for html address tag.

Muhahahaha, i dont call myself DHTML for nothing!
Re: My First Css Quiz / Convert This Css Into Html! by DualCore1: 7:24am On Apr 22, 2011
Na wa. What will we not see on this board.

Monasor, I will recommend your ban if you keep misleading people with your half baked knowledge and if you keep making unwarranted insults. Leave those toys alone and the imaginary height you see yourself in and come down low to the basics and move to the top. Stick around here for a few months in a low profile and you will come out a new improved Monasor 2.0. In a bid to try and make someone look foolish you confirmed your own foolishness. You say crap with so much confidence I get scared like. . . hope you are not responsible for mentoring anyone in this field. Not nice, dude. Live, learn and respect the code or leave it alone.
Re: My First Css Quiz / Convert This Css Into Html! by dhtml3(m): 9:01am On Apr 22, 2011
Mehn, i tire for the guy o. I wonder who he is trying to prove a point to, with all the triaanga wey e dey do
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 2:40pm On Apr 22, 2011
yawa-ti-de:

1) how many would know (or would care to know) that H2 has a font-size of 18px?
2) doesn't the ability to control behaviour via css nullify this?

exactly the answer!


dhtml3:


There are times when you need to do something like this
[h1]Click on this link  [a href='yahoo']yahoo dot com[/a] to continue[/h1]

And you want the link to have same attributes as that h1, are you going to use trial and error
to guess the size? just inspect them.


Well,  instead of going far to use inline style (which to me is not bad but not standard for exact reasons yawatide mentioned]. It is rather simple. If oyu have something like this, all you do is

1] they are under the same parent "div". So, let's assume we call the parent div "title" and we want to style the "h1 and a" the same way. then the answer would be to style them this way

HTML

<div id="title">
       <h1>Click on this link  <a href='yahoo'>yahoo dot com</a> to continue</h1>
       
       other markup. . . .  . . . . . . . . . .
</div>


Style

#title h1, #title h1 a {

font: watever
font-size: watver
bla bla bla

}


#title h1 a {

text-decoration:none;

}

What the text decoration will do is to remove the default browser underline style for links.



This way the "h1 and a" elements have the same styling and no need to look for anything. . .

monasor28:

First of all Nobody does inline styling any more, that is the reason CSS was  created to take care of design properties colors,hieght,transparency e.t.c

And html for structure,  Any way your question is rather childish,  serioulsly who's the not-so-smart person that set the question,  excuse my language but i get upset when
anonymous people display *^$&* symptoms on public boards,

Inline styling as it called would be===

=====================================
<span style="font-size:18px;font-weight:400;line-height:21.6px"> blah blah blah </span>
======================================

DO you have any video tutorial on html5 and css3 --- i cant get my finger around it,  through this lame text,

Mehn. . . As much as you're trying to make sense. You shot yourself with this nonsense jive. I don't go off on people online but your approach is making me develop hormones. Don't always flatter yourself that you know stuffs more than anybody cos at the end of the day, you will definitely find out you know almost nothing.  Web Design did't start at css3 and HTML 5. While you might think you are on top of your game with css3 and html 5, some of us have history that goes way back. You think the post is childish but you never know where it might generate to.  .  . like what I'm seeing now. I've been using firebug for months now and i never noticed what DHTML pointed out. No one knows when he might need stuffs like that.

You brought out that "M.I" website mockup and you thought that was the droppings to yourself but Newsflash "That droppings is Whack". And if you dont believe the poo is whack you can repost it and I'ld show you what I'm talking about.

One again, dont ever assume you know more than anybody.
Re: My First Css Quiz / Convert This Css Into Html! by Nobody: 5:38pm On Apr 22, 2011
In your font-size: blah blah blah. If you do not know the properties of the various formating tags, you will only be doing trial and error
to get the right size. Which is not always too professional.

But either ways, enough said already. Please go and review my dhtml grid control on https://www.nairaland.com/nigeria/topic-652050.0.html
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 6:04pm On Apr 22, 2011
*dhtml:

In your font-size: blah blah blah. If you do not know the properties of the various formating tags, you will only be doing trial and error
to get the right size. Which is not always too professional.


But either ways, enough said already. Please go and review my dhtml grid control on https://www.nairaland.com/nigeria/topic-652050.0.html

I don't really get that. isn't that part of what a designer needs to know? properties of various elements. plus you can't use the default font size of "h2". Is "too big and bold". definitely you want to style in to your taste. . . . hence the properties.
Re: My First Css Quiz / Convert This Css Into Html! by yawatide(f): 8:53pm On Apr 22, 2011
In your font-size: blah blah blah. If you do not know the properties of the various formating tags, you will only be doing trial and error
to get the right size. Which is not always too professional.

Uhhmmmm, what is firebug for? tongue
Re: My First Css Quiz / Convert This Css Into Html! by Nobody: 8:58pm On Apr 22, 2011
yawa-ti-de:

Uhhmmmm, what is firebug for? tongue
It is for brushing your teeth when you wake up in the morning.

bouzymill2:

I don't really get that. isn't that part of what a designer needs to know? properties of various elements. plus you can't use the default font size of "h2". Is "too big and bold". definitely you want to style in to your taste. . . . hence the properties.
In the end, i think this thread is for advance css users, i seem not to have a graceful degradation for newbies, i am sorry about that.
Maybe, we will do a proper css class later on, for now, i am too hooked. . . .
Re: My First Css Quiz / Convert This Css Into Html! by DualCore1: 9:14pm On Apr 22, 2011
*dhtml:

In the end, i think this thread is for advance css users, i seem not to have a graceful degradation for newbies, i am sorry about that.
Maybe, we will do a proper css class later on, for now, i am too hooked. . . .

Thts not acceptable bro, na you start am and na you must put everybody through, even monasor grin
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 9:21pm On Apr 22, 2011
*dhtml:

In the end, i think this thread is for advance css users, i seem not to have a graceful degradation for newbies, i am sorry about that.
Maybe, we will do a proper css class later on, for now, i am too hooked. . . .

And @Monasore28 just called it a childish thread. Very funny. I don't even know why the guy's post took the wrong side in me.
Re: My First Css Quiz / Convert This Css Into Html! by Nobody: 10:52pm On Apr 22, 2011
bouzymill2:

And @Monasore28 just called it a childish thread. Very funny. I don't even know why the guy's post took the wrong side in me.
He obviously does not understand it.
I came about the quiz when i was working on a project, usually when i have an issue like this
[h2]Please click here [a href='#']google.com[/a] to continue[/h2]
As you know, the link size will change from what the h2 tag formats to.
And if you decide to put h2 inside the link, it breaks to next line.

so usual solution, like someone said is to use a style sheet, and then start guessing sizes that will look like h2.
forgetting the fact that h2 and other formating tags have css representations.

so if you make use of the css representations, all your text will blend and you will not be doing trial and error to guess sizes.
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 10:56pm On Apr 22, 2011
*dhtml:


so usual solution, like someone said is to use a style sheet, and then start guessing sizes that will look like h2.
forgetting the fact that h2 and other formating tags have css representations.

so if you make use of the css representations, all your text will blend and you will not be doing trial and error to guess sizes.



<div id="title">
<h1>Click on this link <a href='yahoo'>yahoo dot com</a> to continue</h1>

other markup. . . . . . . . . . . . . .
</div>

Style

#title h1, #title h1 a {

font: watever
font-size: watver
bla bla bla

}


#title h1 a {

text-decoration:none;

}

What the text decoration will do is to remove the default browser underline style for links.



This way the "h1 and a" elements have the same styling and no need to look for anything. . .
Re: My First Css Quiz / Convert This Css Into Html! by DualCore1: 11:13pm On Apr 22, 2011
<style>
h2 a {
  font-family:inherit;
  font-weight:inherit;
  font-size:inherit;
  color:inherit;
}
</style>
<h2>Hey please <a href="#">Click here</a> abeg! </h2>



you can add "text-decoration:inherit" to the style if you like.
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 11:20pm On Apr 22, 2011
Dual Core:

<style>
h2 a {
  font-family:inherit;
  font-weight:inherit;
  font-size:inherit;
  color:inherit;
}
</style>
<h2>Hey please <a href="#">Click here</a> abeg! </h2>

you can add "text-decoration:inherit" to the style if you like.

Internet Explorer doesn't support "inherit" at all. SO it is safe to just declare the values
Re: My First Css Quiz / Convert This Css Into Html! by DualCore1: 11:26pm On Apr 22, 2011
oh screws i forgot about the ie bittch.

in that case its safe to pass both elements through the same stream

h2, h2 a{

}

right?

P.S: Later versions of IE will support inherit, as I gather.
Re: My First Css Quiz / Convert This Css Into Html! by bouzymill2: 11:38pm On Apr 22, 2011
yeah right!

Don't know why they haven't been able to support it since IE7 even if they were bigheaded to support it in IE6
Re: My First Css Quiz / Convert This Css Into Html! by yawatide(f): 12:01am On Apr 23, 2011
Wow! what was meant as a "simple" quiz has blown up into full-fledged debate.

rock on boiz!

(1) (Reply)

Very Urgent! Please Nairalanders Where Can I Register A Domain Name In Ph / Pls How Can I Buy Website Traffic? All These Seo Craps Are Not Working!! / Payza Or Liberty Reserve

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 65
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.