/ Forside/ Teknologi / Internet / Website's / Spørgsmål
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Website's
#NavnPoint
Klaudi 7613
molokyle 7332
refi 3006
jangchr 2550
katekismus 2030
bentjuul 1884
EXTERMINA.. 1570
o.v.n. 1540
marken84 1470
10  disken 1359
center den anden vej!
Fra : Jonner2be
Vist : 561 gange
60 point
Dato : 03-05-05 19:01

Hey!
Jeg skal ikke være html nørd eller noget, bare lige noget jeg hurtig skal bruge...

Jeg skal have center teksten på midten, men IKKE på den måde som når man skriver;
<center></center>
Det skal være den anden vej!
for hvis man skrev det der center, så bliver det kun centeret på siderne! men det skal også være den anden vej!
sådan så det står på noget lignede dette...

start
-------------------------
| |
| |
| |
| her |
| |
| |
| |
-------------------------
slut

hvad hedder det så når det skal den vej?

 
 
Kommentar
Fra : severino


Dato : 03-05-05 19:30

??????????

Kommentar
Fra : emesen


Dato : 03-05-05 19:35

Du anbringer en tabel og cetrerer teksten i den.

Kommentar
Fra : emesen


Dato : 03-05-05 19:37
Kommentar
Fra : molokyle


Dato : 03-05-05 20:15

Glem tabeller

Således : http://www.nwe.ufl.edu/writing/help/web/authoring/html/css/text_control.shtml

..tjek afsnittene om : Horizontal - og Vertical Alignment

..eller læs her : http://www.webdesign101.dk/web102/dhtml/eksempler/eksempel6.php ...trk på linket nederst : Centrer

</MOLOKYLE>

Kommentar
Fra : molokyle


Dato : 03-05-05 20:19

Ps. Samme formregel gælder for tekst i en boxmodel positioneret med CSS egenskaben position:relative;

Boxmodel ? : http://www.stunicholls.myby.co.uk/boxes/index.html

</MOLOKYLE>

Kommentar
Fra : Jonner2be


Dato : 03-05-05 21:26

OMFG!!

Jeg ville bare vide hvordan jeg får "lodret centrering" på!
Jeg ved at "vandret centrering" får man ved at skrive <center>TEKST</center>

skriver vi ingen centrering ser det sådan her ud;
TEKST
Explore;
-------------------------
|TEKST |
| |
| |
| |
| |
| |
| |
-------------------------

Så tager vi vandret centrering på, så det står sådan her;
<center>TEKST</center>
Explore;
-------------------------
| TEKST |
| |
| |
| |
| |
| |
| |
-------------------------

Og det er alt sammen meget fint, men jeg vil have
lavet en lodret centrering, så det kommer til at se sådan her ud;
-------------------------
| |
| |
| |
| TEKST |
| |
| |
| |
-------------------------

Men jeg ved ikke hvordan jeg kan skrive det som html!

OG IKKE GIVE MIG ET LINK TIL "HTML KURSUS" DA JEG HAR LÆST ALT L***ET!
(med mindre jeg har lavet en fejl og læst forbi!)

Kommentar
Fra : emesen


Dato : 03-05-05 22:05

Kode
<body>

<table border="1" width="61%" height="138">
<tr>
<td width="100%" height="132">
<p align="center">abc</td>
</tr>
</table>

</body>

Nu får jeg nok skældud af Molokyle for min fuskekode fra FrontPage. [hør]
Men teksten er da i midten

Kommentar
Fra : molokyle


Dato : 03-05-05 22:13
Kommentar
Fra : Jonner2be


Dato : 04-05-05 08:27

molokyle... jeg får intet ud af at læse alt det der står på de links, fordi jeg forstår hat af det!
Nu er det jeg skal have et billede lodret centrering på...

Accepteret svar
Fra : jjen

Modtaget 60 point
Dato : 04-05-05 08:32

<html>
<table style="height:100%" width="100%">
<td style="text-align:center">
<img src="BILLEDS URL" width="Billeds bredde" height="BILLEDS HØJDE" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></img>
</table>
</body>
</html>

Kommentar
Fra : emesen


Dato : 04-05-05 08:36

Altså et billede med tekst i midten af billedet lodret/vandret.......................ikke
Hvor på siden skal billedet være - eller er det forskelligt.
Er der tale om flere billeder på samme side.

Kommentar
Fra : molokyle


Dato : 04-05-05 08:55

Man kan ikke centrere elementer mellem top og bund på en webside med html ! Ændres skærmopløsningen, så holder den lodrette centrering ikke. Det kan kun lade sig gøre med brug af CSS.

Det er muligt du har læst ALT html literatur der findes, men så burde du også vide at html omhandler en websides indhold. IKKE sidens layout. Dertil bruges CSS. Så måske du skulle boge den lidt i CSS ? Der er kursus her på kandu.dk : http://www.kandu.dk/dk/kurser/css/cssKursus.asp

</MOLOKYLE>



Kommentar
Fra : molokyle


Dato : 04-05-05 09:09

Du kan også 'regne' dig frem i Javascript : http://www.webdesign101.dk/web102/dhtml/dhtmlapi/centrering.php

</MOLOKYLE>

Godkendelse af svar
Fra : Jonner2be


Dato : 04-05-05 20:24

- molokyle, hvis man ikke kan skrive noget, hvorfor er det så lige at jjen's svar passer?
- jjen, Tak for svaret

For at se resultatet glo på www.team-2xplosive.dk

Kommentar
Fra : molokyle


Dato : 05-05-05 11:08

Jonner2be -> Detter ER css :

1.) style="height:100%" width="100%"
2.) style="text-align:center"

..men læs nu lige 'den rigtige' løsning

http://www.netmechanic.com/news/vol7/html_no10.htm

</MOLOKYLE>

Kommentar
Fra : molokyle


Dato : 05-05-05 11:17

Ps. iøvrigt er der fejl i koden : style="height:100%" width="100%"


Den bør retteligt være : style="height:100%";width:100%;"

..men browsere som IE 'retter' fejlen, så det alligevel ser rigtigt ud.

Her er en validering af din HTML :

Citat
No Character Encoding Found! Falling back to UTF-8.I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

So what should I do? Tell me more...

No DOCTYPE Found! Falling Back to HTML 4.01 TransitionalA DOCTYPE Declaration is mandatory for most current markup languages and without one it is impossible to reliably validate this document. I am falling back to "HTML 4.01 Transitional" and will attempt to validate the document anyway, but this is very likely to produce spurious error messages for most non-trivial documents.

So what should I do? Tell me more...

DOCTYPE Fallback in effect!
The DOCTYPE Declaration in your document was not recognized. This probably means that the Formal Public Identifier contains a spelling error, or that the Declaration is not using correct syntax. Validation has been performed using a default "fallback" Document Type Definition that closely resembles HTML 4.01 Transitional, but the document will not be Valid until you have corrected the problem with the DOCTYPE Declaration.
This page is not Valid HTML 4.01 Transitional!
Below are the results of attempting to parse this document with an SGML parser.

Line 1, column 0: no document type declaration; implying "<!DOCTYPE HTML SYSTEM>"

<html>

The checked page did not contain a document type ("DOCTYPE") declaration. The Validator has tried to validate with the HTML 4.01 Transitional DTD, but this is quite likely to be incorrect and will generate a large number of incorrect error messages. It is highly recommended that you insert the proper DOCTYPE declaration in your document -- instructions for doing this are given above -- and it is necessary to have this declaration before the page can be declared to be valid.

&#9993;

Line 2, column 21: document type does not allow element "BODY" here

<body bgcolor="Black">

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

&#9993;

Line 4, column 29: start tag for "TR" omitted, but its declaration does not permit this

<td style="text-align:center">

&#9993;

Line 5, column 65: there is no attribute "MARGINWIDTH"

...width="800" height="600" marginwidth="0" marginheight="0" scrolling="no" fram

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.

&#9993;

Line 5, column 82: there is no attribute "MARGINHEIGHT"

...t="600" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></i..

&#9993;

Line 5, column 96: there is no attribute "SCROLLING"

...width="0" marginheight="0" scrolling="no" frameborder="0"></img>

&#9993;

Line 5, column 113: there is no attribute "FRAMEBORDER"

...eight="0" scrolling="no" frameborder="0"></img>

&#9993;

Line 5, column 116: required attribute "ALT" not specified

...ht="0" scrolling="no" frameborder="0"></img>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

&#9993;

Line 5, column 122: end tag for element "IMG" which is not open

... scrolling="no" frameborder="0"></img>

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occured in a script section of your document, you should probably read this FAQ entry.

&#9993;

Line 8, column 6: end tag for "HTML" which is not finished

</html>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element (e.g. 'ul') which requires a child element (e.g. 'li') that you did not include. Hence the parent element is "not finished", not complete.


Citat
Message Summary
CSE HTML Validator Lite generated 6 error messages and 0 warning messages when checking this web page. These problems could damage this web page's search engine rankings as well as cause viewing problems for visitors. It is highly recommended that any problems be corrected.

URL: <http://www.team-2xplosive.dk/>, Local Time: 4:15:32 AM, Date: Thursday, May 05, 2005

Messages
Type Line Message
Error 4 The "td" element cannot be used here. It is not contained in an element that allows its use. This element may be contained in "tr".
<td style="text-align:center">


Error 5 The "marginwidth" attribute is not valid for the "img" element. Some valid attributes for this element are: "align", "alt", "border", "class", "dir", "height", "hspace", "id", "ismap", "lang", "longdesc", "name", "onabort", "onblur", "onclick", "oncontextmenu", "ondblclick", "onerror", "onfilterchange", "onfocus", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onresize", "src", "style", "title", "usemap", "vspace", and "width".
<img src="images/index.gif" width="800" height="600" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></img>


Error 5 The "marginheight" attribute is not valid for the "img" element. Some valid attributes for this element are: "align", "alt", "border", "class", "dir", "height", "hspace", "id", "ismap", "lang", "longdesc", "name", "onabort", "onblur", "onclick", "oncontextmenu", "ondblclick", "onerror", "onfilterchange", "onfocus", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onresize", "src", "style", "title", "usemap", "vspace", and "width".
<img src="images/index.gif" width="800" height="600" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></img>


Error 5 The "scrolling" attribute is not valid for the "img" element. Some valid attributes for this element are: "align", "alt", "border", "class", "dir", "height", "hspace", "id", "ismap", "lang", "longdesc", "name", "onabort", "onblur", "onclick", "oncontextmenu", "ondblclick", "onerror", "onfilterchange", "onfocus", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onresize", "src", "style", "title", "usemap", "vspace", and "width".
<img src="images/index.gif" width="800" height="600" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></img>


Error 5 The "frameborder" attribute is not valid for the "img" element. Some valid attributes for this element are: "align", "alt", "border", "class", "dir", "height", "hspace", "id", "ismap", "lang", "longdesc", "name", "onabort", "onblur", "onclick", "oncontextmenu", "ondblclick", "onerror", "onfilterchange", "onfocus", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onresize", "src", "style", "title", "usemap", "vspace", and "width".
<img src="images/index.gif" width="800" height="600" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></img>


Error 5 The end tag for "img" was found, but "img" was never opened, has been ended too many times, or cannot have an end tag.
<img src="images/index.gif" width="800" height="600" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></img>


</MOLOKYLE>



Kommentar
Fra : molokyle


Dato : 05-05-05 11:26

Et billede erklæres :

<img .../>

.ikke <img ...>...</img>

marginwidth, marginheight, scrolling og frameborder er alle atibutter der retteligt hører hjemme i en <frame> eller <iframe> ikke i en <img .../>

Tænk at man kan lave så mange fejl i kun 8 linjers kode

</MOLOKYLE>



Du har følgende muligheder
Eftersom du ikke er logget ind i systemet, kan du ikke skrive et indlæg til dette spørgsmål.

Hvis du ikke allerede er registreret, kan du gratis blive medlem, ved at trykke på "Bliv medlem" ude i menuen.
Søg
Reklame
Statistik
Spørgsmål : 177579
Tips : 31968
Nyheder : 719565
Indlæg : 6409073
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste