Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Co zrobić aby tekst nie przechodził do nowej lini?
kari
post 17.01.2008, 19:20:43
Post #1





Grupa: Zarejestrowani
Postów: 52
Pomógł: 0
Dołączył: 1.03.2005

Ostrzeżenie: (0%)
-----


Upraszczając sprawę, to w css'ie mam coś takiego:
  1. #srodkowanie {
  2. position: absolute;
  3. left: 50%;
  4. right: 50%; }

W html'u wygląda to następująco:
  1. <div id="srodkowanie">
  2. <div id="tekst"><p>tekst tekst tekst</p></div>
  3. </div>


I teraz co zrobić, aby tekst nie był dzielony przy każdej spacji.


--------------------
(\.../)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination.
Go to the top of the page
+Quote Post
czachor
post 17.01.2008, 19:46:14
Post #2





Grupa: Zarejestrowani
Postów: 897
Pomógł: 40
Dołączył: 16.12.2003
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Kod
#tekst p {
     white-space: nowrap;
}

(dla IE działa od v6)


--------------------
how many SEO experts does it take to change a light bulb,lightbulb,light,bulb,lamp,lighting,switch,sex,xxx
5-Reasons-why-you-should-NEVER-fix-a-computer-for-free
Go to the top of the page
+Quote Post
kari
post 17.01.2008, 20:38:43
Post #3





Grupa: Zarejestrowani
Postów: 52
Pomógł: 0
Dołączył: 1.03.2005

Ostrzeżenie: (0%)
-----


A wcześniejsze wersje?
Mam jeszcze jedno pytanie. Po zastosowaniu sposobu ze strony TwinHelix na przezroczyste png w IE, nie chce mi w tej przeglądarce działać "background-repeat". Jest na to jakiś sposób?


--------------------
(\.../)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination.
Go to the top of the page
+Quote Post
czachor
post 17.01.2008, 20:59:17
Post #4





Grupa: Zarejestrowani
Postów: 897
Pomógł: 40
Dołączył: 16.12.2003
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


A wcześniejsze wersje niet :] Możesz próbować szukać jakiegoś hacka, ale wątpię, żeby był na to. A niżej hack na przezroczystość PNG (używam go na mojej stronie).


Kod
/*

Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters))
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}


Ten post edytował czachor 17.01.2008, 20:59:43


--------------------
how many SEO experts does it take to change a light bulb,lightbulb,light,bulb,lamp,lighting,switch,sex,xxx
5-Reasons-why-you-should-NEVER-fix-a-computer-for-free
Go to the top of the page
+Quote Post
batman
post 17.01.2008, 21:08:19
Post #5





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




W CSS nie ma raczej hack-a na nowrap w IE6. Wydawało mi się, że to działa w IE6.
Jeśli nie chcesz, by się Twoja strona poprawnie walidowała, możesz użyć znacznika:
  1. <nobr>jakis tekst</nobr>
Jednak jak już wspomniałem, nie przejdzie on walidacji.


--------------------
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Go to the top of the page
+Quote Post
kari
post 19.01.2008, 18:55:38
Post #6





Grupa: Zarejestrowani
Postów: 52
Pomógł: 0
Dołączył: 1.03.2005

Ostrzeżenie: (0%)
-----


Jeszcze coś, co mnie dość irytuje winksmiley.jpg
Teksty mam umieszczone w znacznikach <p></p>. I teraz w FF powoduje to, że mają one pewien margines, a IE wyświetla wszystko dobrze. Jak możżna usunąć ten margines i tak w zasadzie do czego on służy??

A co do skryptu czachor'a, to używałem go wcześniej, ale od jakiegoś czasu nie chce działać. i to nie tylko mi.

Ten post edytował kari 19.01.2008, 18:57:28


--------------------
(\.../)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination.
Go to the top of the page
+Quote Post
sobstel
post 19.01.2008, 19:05:04
Post #7





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

Ostrzeżenie: (0%)
-----


p{margin:0;padding:0}

niektóre przeglądarki mają dla kilku elementów prdefiniowane style, np. marginesy. zawsze możesz sprobować zresetować wszystkie style


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
kari
post 21.01.2008, 10:56:37
Post #8





Grupa: Zarejestrowani
Postów: 52
Pomógł: 0
Dołączył: 1.03.2005

Ostrzeżenie: (0%)
-----


Następne pytanie winksmiley.jpg
Wykonałem sobie proste menu w css. Użyłem w nim polecenia "div:hover#przycisk1 { background-position: 0 20px; }". Tyle, że w IE jak zwykle to nie chce zadziałać. Jest jakiś sposób na poprawienie tego dla IE?


--------------------
(\.../)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination.
Go to the top of the page
+Quote Post
batman
post 21.01.2008, 10:58:20
Post #9





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




IE ma to do siebie, że nie interpretuje pseudoklasy :hover dla elementów innych niż a. Poszukaj na google "css hover ie".


--------------------
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Go to the top of the page
+Quote Post
mike
post 21.01.2008, 11:15:38
Post #10





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


1.
Kod
div#przycisk1:hover { background-position: 0 20px; }

2. Gotowiec: whatever:hover
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.03.2024 - 18:47