Jump to content

Need formatting help quick


Recommended Posts

Hi!We're having an exam project at school that's gonna be handed in next thursday 15th November and it's gonna be a html solution (or xhtml) but we can't use CSS or tables...So my question is: How can I get two different paragraphs or a paragraph and an image om the same line if all the tags we're allowed to use are what's listed below...<?xml version="1.0" encoding="iso-8859-1" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="no" lang="no"><head><title> </title></head><body><h1> <h1<h2></h2><h3></h3><p> All text that isn't a list or a heading goes in a paraghraph </p>Unordered list<ul><li></li></ul></li></ul>Ordered list<ol><li>List item 1</li><li>List with a <ul><li>under item</li></ul></li></ol>Simple link:<p><a href="page2.html" title="Examplel "> Here you get to page2</a></p>Bilde:<p><img src="litebilde.gif" alt="Alternative text to an image that doesn't exist" /></p>Picture with link 1:<p><a href="example.html" title="Link from image"><img src="Fintbilde.gif" alt="Explaining text instead of image" /> </a></p>Picture with link 2:<p><a href="example.html" title="explanation of picture with mouseover"><img src="Fintbilde.jpg" alt=" " /></a></p></body></html>

Link to post
Share on other sites

I'm assuming you can't use JavaScript either huh?Some quick code I made:

<p><img align="left" src="" alt="" height="200" width="200" />  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.  This is a simple paragraph.</p><p>  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.  This is another paragraph.</p>

Looking for something like this? Like you said, this puts the paragraph and image on the same line.You can change the "align" attribute on the image to "right" or "left" to change which side it's on. This is NOT valid HTML or XHTML since I'm using the align attribute with along with "height" and "width". Usually that would be CSS taking care of that.

Link to post
Share on other sites
we can't use CSS
:) Are you sure..?You can easily get an image and some text on one line (just place them next to each other), but his problem is that he wants the two paragraphs to be next to each other, but without CSS he can't use float. Hrmmmm... isn't it sort of cheating if we help you? I don't see any way this is possible without CSS or tables... tell us how your teacher does it and what the class's average mark is after Thursday :)Hmm... I wonder if JavaScript-applied CSS is acceptable...
Link to post
Share on other sites
Guest FirefoxRocks

If you need either one (paragraph + image or paragraph + paragraph), the image one is much easier. You do this:

<p>some text, make sure that it fills the height of the image sufficiently.</p><p><img src="yourimage.gif" alt="alternate text" align="right"></p>

I absolutely do not recommend doing this for regular web pages, but it is a non CSS and non-JavaScript solution to the problem. You didn't mention the document having to be in HTML (or XHTML) strict. This is HTML (or XHTML) transitional, but it should work.

Link to post
Share on other sites

Nope, that won't work because the first P tag will force a lf+cr.OP:

We're having an exam project at school that's gonna be handed in next thursday 15th November and it's gonna be a html solution (or xhtml) but we can't use CSS or tables...
Since this is some course work, I need to ask whether the Instructor is aware of the term 'semantics' as it relates to html pages, and are you certain that CSS is not allowed to be used?
Link to post
Share on other sites

Their idea is to give us very little posibilities when it comes to styling, so that we're forced to think creative ways to make it work...So we can absolutely not use anything at all other than what is listed above...And that's why I'm asking how to get two paragraphs on the same line cause I don't see that happening when we're only allowed to use the above tags...

Link to post
Share on other sites
Guest FirefoxRocks
http://www.jlhaslip.trap17.com/samples/misc/demo/ul.html :) And it validates, but it is not semantically correct, so I do not recommend using it on a page, but if that is what they want you to learn, so be it... :)
A few problems with that:1. It does not validate2. The paragraph beside the paragraph is just written in the same paragraph, so that is 1 paragraph.3. You forgot to close your </li> and </p> tags.
Link to post
Share on other sites
Their idea is to give us very little posibilities when it comes to styling, so that we're forced to think creative ways to make it work...So we can absolutely not use anything at all other than what is listed above...And that's why I'm asking how to get two paragraphs on the same line cause I don't see that happening when we're only allowed to use the above tags...
... and what's wrong with the code that I posted? It does exactly what you say. In fact, it will display the image besides two paragraphs. You can take off the "height" and "width" attributes and leave the "align" attribute on, and it will at least validate as XHTML or HTML transitional.Edit: I just noticed that "align=" isn't in your code. Darn those teachers.
Link to post
Share on other sites

1. It does not validateAccording to HTML Tidy in Firefox it does.2. The paragraph beside the paragraph is just written in the same paragraph, so that is 1 paragraph.See OP's note re: creativity.3. You forgot to close your </li> and </p> tags.Read the specs, closing tags are optional for both p and li's. Add them if you wish.

Link to post
Share on other sites
1. It does not validate
I think that is the least of his worries at this time :)
Link to post
Share on other sites
Guest FirefoxRocks
1. It does not validateAccording to HTML Tidy in Firefox it does.2. The paragraph beside the paragraph is just written in the same paragraph, so that is 1 paragraph.See OP's note re: creativity.3. You forgot to close your </li> and </p> tags.Read the specs, closing tags are optional for both p and li's. Add them if you wish.
1. According to the official W3C validator, it isn't valid. Are you sure it is in HTML Tidy for Firefox, try clearing your cache.2. Huh?3. They are mandatory for valid pages in XHTML.
Link to post
Share on other sites

I see this task impossible: all block level elements have a line break before and after. <ul> is a block element, <li> is a block element, <p> is a block element. Without CSS, tables or javascript I don't see a solution. Whenever your teacher gives the solution would you mind telling it here? I'd be glad to learn how to do something like that.

Link to post
Share on other sites
I see this task impossible: all block level elements have a line break before and after. <ul> is a block element, <li> is a block element, <p> is a block element. Without CSS, tables or javascript I don't see a solution. Whenever your teacher gives the solution would you mind telling it here? I'd be glad to learn how to do something like that.
I don't think we get an answer :)
Link to post
Share on other sites

Take one for the team thokin! We can all learn from your mistakes, lol.Just kidding. :)But if you do ever get a answer, please post it.

Link to post
Share on other sites

Well, you can say to your teacher if he/she does not reveal the answer "if you can't solve it, how do you expect us to?" :)

Link to post
Share on other sites

Simple, cheat. Don't separate the paragraphs. Just add   until they appear aligned. A simple illusion, so long as the teacher takes it for granted. Make it look like so:

A sample sentence. A sample          Another sample sentence.  AnotherSentence A sample sentence.          sample sentence.  Another sample                                     sentence.

Link to post
Share on other sites

Well, he could have a one-line paragraph and a child image

<p>One line of text<img /></p>

Then they are next to each other :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...