Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS] Zmiana wyglądu formularza
kujol
post 25.07.2013, 12:31:21
Post #1





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Witam.
Jak mogę zmienić wygląd pola tekstu w formularzu za pomocą css np. takiego:

Kod
<form method="POST" action="ljakasstrona.php">
<b>login:</b><input type="text" name="login"><br />
<b>haslo:</b><input type="password" name="haslo"><br />
<input type="submit" value="zaloguj się" name="zaloguj"><br />
</from>


--------------------
;)
Go to the top of the page
+Quote Post
fate
post 25.07.2013, 12:38:04
Post #2





Grupa: Zarejestrowani
Postów: 824
Pomógł: 106
Dołączył: 14.03.2012
Skąd: Warszawa

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


Zależy co chcesz zmieniać, tło, czcionke, obramowania, wielkosc,obrazki itd
Jak nie znasz CSS
to zerknij wpierw tu:
http://www.smashingapps.com/2010/04/19/10-...-and-grids.html


--------------------
Go to the top of the page
+Quote Post
kujol
post 25.07.2013, 22:07:15
Post #3





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Jak można zrobić takie coś aby po kliknięciu w pole formularza automatycznie znikał text-czyli jego wartość.


--------------------
;)
Go to the top of the page
+Quote Post
aras785
post 25.07.2013, 22:11:21
Post #4





Grupa: Zarejestrowani
Postów: 859
Pomógł: 177
Dołączył: 29.10.2009

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


np: http://jsfiddle.net/xbeR2/17/
Go to the top of the page
+Quote Post
kujol
post 26.07.2013, 18:20:58
Post #5





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Zrobiłem tak, ale po kliknięciu napis nie znika

Kod
<html>
<head>
<script>

$('input[type=text]').on('click focusin', function() {
    if(this.value=='wpisz cos') this.value = '';
});

</script>
</head>
<body>

<input type="text" value="wpisz cos"/>

</body>
</html>



I czy są jakieś darmowe edytory do programowania, taki w którym można używać polskich znaków, bo na razie piszę w notepad++, a może da się
go jakoś skonfigurować?


--------------------
;)
Go to the top of the page
+Quote Post
fate
post 26.07.2013, 18:35:29
Post #6





Grupa: Zarejestrowani
Postów: 824
Pomógł: 106
Dołączył: 14.03.2012
Skąd: Warszawa

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


edytor masz dobry
musisz zmienic kodowanie na takie jak na stronie najlepiej tu i tu UTF-8

Ja uzywam do teho skryptu stad w JS
http://funkcje.net/view/2/3058/

CODE
<input name=" " value="Wpisz szukane słowo" onfocus="if(this.value=='' || this.value == 'Wpisz szukane słowo') this.value=''" onblur="if(this.value == '') {this.value=this.defaultValue}" onkeyup="keyUp();" type="text">


do tego co ci kolega podal musisz dokleic biblioteke jquery zeby zadziałało.


--------------------
Go to the top of the page
+Quote Post
kujol
post 28.07.2013, 16:54:45
Post #7





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Mam na stronie kilka przycisków i każdy ma mnie przekierować gdzieś indziej, wygląda to tak:

Kod
<from action="cos111.php"><input type="submit" value="Start" id="G1"></from>
    
<from action="cos222.php"><input type="submit" value="Menu" id="G2"></from>
    
<from action="cos333.php"><input type="submit" value="Koszyk" id="G3"></from>
    
<from action="cos444.php"><input type="submit" value="Szukaj" id="G4"></from>
    
<from action="cos555.php"><input type="submit" value="Zarejestruj się" id="G5"></from>


Lecz wszystkie przekierowują mnie na cos111.php
Jak można temu zaradzić?

nerdsmiley.png


--------------------
;)
Go to the top of the page
+Quote Post
b4rt3kk
post 28.07.2013, 17:20:09
Post #8





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Proponuje zastąpić from, znacznikiem form (to jeśli idzie o to co napisałeś w ostatnim poście). A tak w ogóle to na cholerę te formularze potrzebne? Zwykły link nie wystarczy?

  1. <a href="cos111.php">Klik</a>


--------------------
Jeśli pomogłem, kliknij proszę 'pomógł'. Dzięki.
Go to the top of the page
+Quote Post
kujol
post 28.07.2013, 17:48:45
Post #9





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Cytat
A tak w ogóle to na cholerę te formularze potrzebne? Zwykły link nie wystarczy?


Chcę zrobić z tych przycisków ładne menu poziome.
Robiłem wcześniej tak:

menu.html
Kod
<ul>
<li><a href="czcionki.html">Czcionki</a></li>
<li><a href="tekst.html">Tekst</a></li>
<li><a href="tlo.html">Tło</a></li>
<li><a href="marginesy.html">Marginesy</a></li>
<li><a href="obramowanie.html">Obramowanie</a></li>
</ul>



style.css
Kod
ul, ul li {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
}

ul li {
    float: left;
}

ul a:link, ul a:visited {
    text-decoration: none;
    display: block;
    width: 80px;
    text-align: center;
    background-color: #ccc;
    color: #000;
    border: 2px outset #ccc;
    padding: 5px;
}

ul a:hover {
    border-style: inset;
    padding: 7px 3px 3px 7px;
}



Ale nie za bardzo wiem jak przypisać style do drugiego menu, ponieważ potrzebne mi są 2. Może ktoś pomoże:D


--------------------
;)
Go to the top of the page
+Quote Post
Turson
post 28.07.2013, 18:18:39
Post #10





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


  1. #JakasKlasa ul, li
Go to the top of the page
+Quote Post
kujol
post 28.07.2013, 18:38:27
Post #11





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Robię ramki na div'ach
i do tej pory było wszystko ok, ale teraz gdy coś dodaję lub pomniejszam albo powiększam wielkość w przeglądarce to wszystko się rozjerzdża, można to jakoś po blokować lub zastąpić czymś innym.
Przed dodaniem wygląda to tak:
normalnie

Po dodaniu jakiegoś elementu:
po dodaniu


--------------------
;)
Go to the top of the page
+Quote Post
Turson
post 28.07.2013, 19:09:09
Post #12





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Problem leży w cssie. Widocznie źle zakodowałeś stronę
Go to the top of the page
+Quote Post
kujol
post 29.07.2013, 09:03:07
Post #13





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Css wygląda następująco:

Kod
#top1
{
width: 100%;
}


#top
{
width: 1024px;
margin-left: auto;
margin-right: auto;

}

#NAGLOWEK
{
background-color: #EE2C2C;
height:5px;
}

#NAGLOWEK1
{
background-color: #EE2C2C;
width:508px;
height:40px;
border-bottom-right-radius: 26px;
border-bottom-left-radius: 26px;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
}

#NALOGIN
{
background-color: #EE2C2C;
width:180;
height:80px;
border-bottom-right-radius: 26px;
border-bottom-left-radius: 26px;
float: right;
position: relative; top: -41px;
text-align: center;
font-size: 20px;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
}

#LOGIN
{
width:120;
height:20px;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 7px;
border-top-right-radius: 7px;
border-top-left-radius: 7px;
}

#HASLO
{
width:120;
height:20px;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 7px;
border-top-right-radius: 7px;
border-top-left-radius: 7px;
}

#GUZIK
{
width:80;
height:20px;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 7px;
border-top-right-radius: 7px;
border-top-left-radius: 7px;
position: relative; top: 8px;
position: relative; left: 20px;
cursor: hand;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
}

#WYSZUKIWARKA
{
background-color: #EE2C2C;
width:180;
height:25px;
border-top-right-radius: 26px;
border-top-left-radius: 26px;
float: left;
text-align: center;
font-size: 20px;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
position: relative; top: 150px;
}

#KOSZYK
{
background-color: #EE2C2C;
width:180;
height:25px;
border-top-right-radius: 26px;
border-top-left-radius: 26px;
float: right;
text-align: center;
font-size: 20px;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
position: relative; top: 150px;
position: relative; left: 181px;
}

#NOWOSCI
{
background-color: #EE2C2C;
width:645;
height:25px;
border-top-right-radius: 26px;
border-top-left-radius: 26px;
float: none;
text-align: left;
font-size: 20px;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
position: relative; top: 150px;
position: relative; left: 188px;
}

#nowosci1
{
position: relative; right: 150px;
}

#Logo
{
background-color: #EE2C2C;
width:400;
height:128px;
float: left;
text-align: center;
font-size: 20px;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
position: relative; top: -17px;
background-image: url(logo.jpg)
}

#G1
{
background-color: #838B8B;
float: left;
cursor: hand;
position: relative; top: -70px;
position: relative; left:-382px;
width: 90px;
height: 35px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
}

#G2
{
background-color: #838B8B;
float: left;
cursor: hand;
position: relative; top: -85px;
position: relative; left:-377px;
width: 90px;
height: 35px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
}

#G3
{
background-color: #838B8B;
float: left;
cursor: hand;
position: relative; top: -85px;
position: relative; left:-372px;
width: 90px;
height: 35px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
}

#G4
{
background-color: #838B8B;
float: left;
cursor: hand;
position: relative; top: -85px;
position: relative; left:-367px;
width: 90px;
height: 35px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
}

#G5
{
background-color: #838B8B;
float: left;
cursor: hand;
position: relative; top: -120px;
position: relative; left:-2px;
width: 90px;
height: 35px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
}

#wyszukiwarka1
{
position: relative; top: 105px;
position: relative; left: -491px;
}

#wyszukiwarkapole
{
width: 122px;
height: 35px;
text-align: center;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
}

#wyszukiwarkaguzik
{
width: 55px;
height: 35px;
text-align: center;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-style: solid;
border-right-color: black;
border-left-color: black;
border-bottom-color: black;
border-top-color: black;
border-right-width: 1px;
border-left-width: 1px;
border-bottom-width: 1px;
border-top-width: 1px;
cursor: hand;
}

#KATEGORIA
{
background-color: #EE2C2C;
width:180;
height:25px;
border-top-right-radius: 26px;
border-top-left-radius: 26px;
text-align: center;
font-size: 20px;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
position: relative; top: 250px;
}


--------------------
;)
Go to the top of the page
+Quote Post
-Gość-
post 29.07.2013, 09:29:30
Post #14





Goście







w tym tempie Twoj kod CSS bedzie zajmowal wiecej niz Twoja strona + tresc

np.
  1. border-bottom-right-radius: 5px;
  2. border-bottom-left-radius: 5px;
  3. border-top-right-radius: 5px;
  4. border-top-left-radius: 5px;

=

  1. border-radius: 5px;


Go to the top of the page
+Quote Post
kujol
post 30.07.2013, 09:28:02
Post #15





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Da się jakoś tą ramkę na div'ach podpiąć na inne podstrony, bez konieczności wklejania tam całego kodu?


--------------------
;)
Go to the top of the page
+Quote Post
Turson
post 30.07.2013, 11:38:03
Post #16





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Nie bardzo rozumiem. O jakiej ramce na divach mówisz?
Go to the top of the page
+Quote Post
fate
post 30.07.2013, 11:40:47
Post #17





Grupa: Zarejestrowani
Postów: 824
Pomógł: 106
Dołączył: 14.03.2012
Skąd: Warszawa

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


tak samiast id
#KATEGORIA
zrób klasę
.KATEGORIA

i na podstronach uzywaj zamist id="kategoria" class="kategoria"


--------------------
Go to the top of the page
+Quote Post
kujol
post 30.07.2013, 18:34:40
Post #18





Grupa: Zarejestrowani
Postów: 324
Pomógł: 27
Dołączył: 21.07.2013

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


Taki kod "ramki", która na razie wygląda tak Strona + do niego css, który znajduje się powyżej.

index.html

Kod
<html>
<head>
<link rel="stylesheet"
href="plikstyli.css"
type="text/css" />
</head>
<body bgcolor=#EEE8CD>
<div id="top1">
    <div id="NAGLOWEK"></div>    
    
</div>
<div id="top">
<div id="NAGLOWEK1">


</div>

    <div id="NALOGIN"><form method="POST" action="logowanie.php">
<input type="text" name="login" value="Login" id="LOGIN"><br />
<input type="password" name="haslo" value="Haslo" id="HASLO"><br />
<input type="submit" value="zaloguj się" name="zaloguj" id="GUZIK"><br />
</form>
</div>
    <div id="WYSZUKIWARKA">Wyszukiwarka</div>
    <div id="KOSZYK">Koszyk</div>
    <div id="NOWOSCI"><div id="nowosci1">Nowosci</div></div>
    <div id="LOGO"></div>
    
</div>

    <form action="cos.php"><input type="submit" value="Start" id="G1"></form>
    <form action="costam.php"><input type="submit" value="Menu" id="G2"></form>
    <form action="cosbts.php"><input type="submit" value="Koszyk" id="G3"></form>
    <form action="cos11d.php"><input type="submit" value="Szukaj" id="G4"></form>
    <form action="cosmkw.php"><input type="submit" value="Zarejestruj się" id="G5"></form>

<form method="POST" action="szukaj.php" id="wyszukiwarka1">
<input type="text" name="szukaj" value="szukany produkt" id="wyszukiwarkapole">
<input type="submit" name="wyszukaj" value="szukaj" id="wyszukiwarkaguzik">
</form>





</body>
</html>


Chciałbym to połączyć z np. podstrona.html, na której znajdują tylko treści, bez potrzeby wstawiania tam całego kodu i umieszczania dopiero w nim tej treści. W index.html znajduje się tylko sama struktura ramki.
I nie wiem czy tak się w ogóle da scalić to jak index.html z plikstyli.css.


--------------------
;)
Go to the top of the page
+Quote Post
Turson
post 30.07.2013, 23:28:46
Post #19





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Rozumiem, że chcesz includować podstronę bez ładowania całego layoutu
  1. $page = ((isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'] : 'index');
  2. $page=(preg_match('/(\.\.|\/)/i',$page)?'index':$page);
  3. $page = preg_replace('/[^a-zA-Z0-9 \._-]/','',$page);
  4. $page = (file_exists('include/'.$page.'.php') ? $page : 'error');
  5. include('include/'.$page.'.php');

Skonfiguruj wg. własnych potrzeb. Wstaw w index.php w miejscu gdzie jest zasadnicza część strony
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: 6.06.2025 - 18:19