HTML: Вопросы по мелочи

A

Anonymous

Ссори за оффтоп, я уже во всем разобрался
 

Night_Elf

Старожил
блин, тим, html к корелу никаким боком не относится, не засоряй тему плиз.

Добавлено спустя 35 секунд:

Проблемка....
Есть картинка, являющаяся ссылкой:
<a href="..."><img></a>
Для ссылки сделана такая таблица стилей:
Код:
	border: 1px solid Gray;
	display: block;
	width: 110px;
	height: 110px;
	background: #D9D9D9;
	vertical-align: middle;
	text-align: center;
	padding: 2 2 3 2;
Для ячейки таблицы, в которой это всё находится, valign=middle.
Но картинка, находящаяся внутри ссылки, прилипает к верхнему краю, что мне совсем не нравится.
Вот пример:
http://elf.gtn.ru/author/The%20Art%20of ... 20Mullins/

Как заставить картинку сидеть по центру квадратика-ссылки?
 
A

Anonymous

сделай отступы... cellspacing и cellpadding.
если в коде написал также (valign=middle), надо кавычки поставить. Синтаксис типа.
 

Night_Elf

Старожил
кавычки есть. Хотя вообще они не обязательны. cellspacing и cellpadding - это не то, это отступы от границ таблицы и от границ ячейки. Мне-то надо заставить изображение, находящееся внутри ссылки, сидеть посередине этой самой ссылки.

Блин, не знаю как объяснить, я там ссылку давал, там видно в чем проблема.
 

kenZZZo

Старожил
привет
мне кажется, что здесь проще будет сделать javascript'ом,
потому что решение с помощью css лежит явно не на поверхности

<td onClick="..." onMoseOver="..."><img ... ></td>
в стиле td не забудь указать cursor: pointer;
 

ND

Бывалый
Возникла необходимость реализации min-width/max-width в IE.
В инете много реализаций и вообщем то 2 способа:

1). JavaScript хак: что то типа
Код:
width:expression(document.body.clientWidth > 400 ? "400px":"auto" );
2). Коллекция из контейнеров
Код:
style type="text/css">
.width {
  width:60%;
  min-width:350px;
}

.content {
  border:1px solid #F60;
  padding:5px;
}

* html .minwidth {
  padding-left:350px;
}

* html .container {
  margin-left:-350px;
  position:relative;
}

/*\*/
* html .minwidth,
* html .container,
* html .content,
* html .layout {
  height:1px;
}
/**/

</style>

[b]...[/b]

<div class="width">
 <div class="minwidth">
  <div class="layout">
   <div class="container">
    <div class="content">
     
<h3>{width:60%; min-width:350px;}
для Internet Explorer</h3>

    </div>
   </div>
  </div>
 </div>
</div>

И тут встаёт выбор: либо плодить контейнеры, но все стили можно будет поместить в css файл, либо надется на то, что у пользователя включён js и добавить стиль в MasterPage.

У кого какие мысли?
 

Zeddd

Старожил
подскажите ктонить
нужна страничка стандарта XHTML 1.0 Strict кодировка utf-8
по центру написано большими буквами : бла-бла
должно быть на странице по центру, крупно. Если менять
размер окна "бла-бла" должно автоматически центрироваться
цвет фона зелёный
"бла-бла" должно отражаться в имени окна
Файл должен смотреться одинаково и Эксплорере, Опере и Файрфоксе

кто может подскажите код пожалуйста

в принципе мне нужна помощь , относительно текста "бла-бла"

Добавлено спустя 27 секунд:

заранее большое спасибо!
 

Crash

Старожил
Может тогда проще сделать три файла: для оперы, ослика и файрфокса и в зависимости от от типа браузера подгружать один из них?
 

A4

Старожил
нужна страничка стандарта XHTML 1.0 Strict кодировка utf-8
зачем? :shock:
это делается обычной таблицей, работает везде одинаково.
но насчёт стрикта я не уверен, проверь :)
Код:
<html>
<head>
<title>bla-бла</title>
<meta http-equiv="сontent-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="green">
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td align="center"><h1>бла-бла</h1></td></tr>
</table>
</body>
</html>
параметры текста в теге H1 просто описать с помощью css
Код:
<h1 style="font: normal bold 150px Tahoma; color:#FFF">текст</h1>
 

Zeddd

Старожил
на http://validator.w3.org проверяю , выдаёт ошибки:
Jump To:
ResultsResult: Failed validation, 3 errors
File: 111.html
Encoding: utf-8
Doctype: (no Doctype found)

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.

Read the FAQ entry on character encoding for more details and pointers on how to fix this problem with your document.
No DOCTYPE found! Attempting validation with HTML 4.01 Transitional.

The DOCTYPE Declaration was not recognized or is missing. 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 this problem with the DOCTYPE Declaration.

Learn how to add a doctype to your document from our FAQ.
This page is not Valid (no Doctype found)!

Below are the results of attempting to parse this document with an SGML parser.
Error 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 a fallback 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.


Error Line 4 column 18: character "с" is not allowed in the value of attribute "HTTP-EQUIV".
<meta http-equiv="��ontent-type" content="text/html; charset=utf-8">

It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.


Error Line 7 column 27: there is no attribute "HEIGHT".
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">

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. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

я извиняюсь , но хорошо бы чтоб не выдавал ошибку на http://validator.w3.org/

Добавлено спустя 7 минут 40 секунд:

пока проблема с текстом
с цветом вроде разобрался :
<!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">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>БЛА-БЛА</title>
<style type="text/css">
<!--
body {
background-color: #00FF00;
}
-->
</style>

<body>
</body>
</html>
 

A4

Старожил
Код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head> 
<title>бла-бла</title> 
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
</head> 
<body style="background-color: green"> 
<div style="margin-top: 25%; margin-left:45%; vertical-align: middle;"><h1>бла-бла</h1></div>
</body> 
</html>
так работает, но кривовато
попозже подумаю ещё
 

gram

Старожил
ND":zi3nysca сказал(а):
Возникла необходимость реализации min-width/max-width в IE. В инете много реализаций и вообщем то 2 способа: И тут встаёт выбор: либо плодить контейнеры, но все стили можно будет поместить в css файл, либо надется на то, что у пользователя включён js и добавить стиль в MasterPage. У кого какие мысли?
Если у тебя сайт полюбому без JS жить не может, тогда можно и первый, но я бы сделал 2 css файла с ie conditional comments, потому что ie7 уже все поддерживает. Иначе - второй. Так же можно второй, если у тебя это одно единственное место на странице. Ну в общем-то тут исключительно на вкус и цвет :)
 

A4

Старожил
A4":38go7hcz сказал(а):
попозже подумаю ещё
Код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head> 
<title>bla-bla</title> 
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
<style type="text/css">
html,body { height:100%; margin:0px; padding:0px )
</style>
</head> 
<body style="background-color: green"> 
<table width="100%" style="height: 100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center"><h1>bla-bla</h1></td>
</tr>
</table>
</body> 
</html>
 

A4

Старожил
пожалуйста. только зачем тебе стрикт, я так и не понял? =)
 

gram

Старожил
потому что strict рулит :) не учи человека плохому, пускай на xhtml сразу пишет
 

A4

Старожил
да я наоборот сам хорошему хочу поучиться :)
 
A

Anonymous

.... <a href="http://www.nundesign.com/st/30.html"link="#ffffff" alink="#ffffff" vlink="#ffffff"> <b>Источник </a><br><br><br><a href="Frames whith menu.html" align="left"link="#ffffff" alink="#ffffff" vlink="#ffffff"> Главная </a> <a href="design.html" align="left"link="#ffffff" alink="#ffffff" vlink="#ffffff"> Наверх </a> </body> </head> </html>
К ссылке прописываю цвет, но отображается дурацкий стандартный сине-фиолетовый. В чем проблема, подскажет кто?
 

Кекс

Старожил
Цвет потому что не так прописываешь :)
"alink", "vlink" - это не свойства тэга <a>.
Так что пиши класс ссылок в CSS, а самой ссылке этот класс и присваивай. Например:

Код:
<head>
<style>
a.mylink {color: #4455ff; text-decoration: none}
a.mylink:hover {color: #222222; text-decoration: underline}
a.mylink:visited {color: #ff55ff}
</style>
</head>

<body>
...
<a class=mylink>...
И кавычки можно не писать :wink:
И названия html-доков без пробелов сделай.
 
Верх