![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 15.01.2008 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Witam Was.
W końcu wziąłem się za poważniejszy projekt niż tylko HTML i oto pojawił mi się malutki problem. Mianowicie chciałbym zamienić przycisk z Napisu "Włączony" czy "Wyłączony" na przycisk w formie graficznej. Byłby ktoś tak uprzejmy i podpowiedział jak to zrobić ?
|
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 2 592 Pomógł: 445 Dołączył: 12.03.2007 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 15.01.2008 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 2 592 Pomógł: 445 Dołączył: 12.03.2007 Ostrzeżenie: (0%) ![]() ![]() |
To podaj prawidłowy URL obrazka, poza tym skąd ja mam wiedzieć co się dzieje później z $nowyStan skoro nie pokazałeś kodu, który obrabia dalej tą zmienną?
|
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 15.01.2008 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Link do grafiki:
images/light_on.png Aktualnie kod wygląda tak:
|
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 2 592 Pomógł: 445 Dołączył: 12.03.2007 Ostrzeżenie: (0%) ![]() ![]() |
To z powodu linii 110:
Czyli kod generuje Ci zwykły input submit. Opcji masz kilka: - ostylowanie inputa w zależności od klasy - zamiana input na button, np linię 110 podmieniasz na
|
|
|
![]()
Post
#7
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 15.01.2008 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
czyli rozumiem że zrobić w css klasę jakiButon i ją ustawić na plik graficzny (IMG:style_emoticons/default/questionmark.gif)
|
|
|
![]()
Post
#8
|
|
Grupa: Zarejestrowani Postów: 2 592 Pomógł: 445 Dołączył: 12.03.2007 Ostrzeżenie: (0%) ![]() ![]() |
Szybciej jak podmienisz linię 110 na to co wkleiłem w ostatnim bloku kodu.
|
|
|
![]()
Post
#9
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 15.01.2008 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
zmienił mi to tylko nazwę przycisku na button2 lub button1
teraz muszę zdefiniować jakoś grafikę tego przycisku (IMG:style_emoticons/default/questionmark.gif) CSS CODE @charset "UTF-8"; @import url(font-awesome.min.css); @import url("http://fonts.googleapis.com/css?family=Source+Sans+Pro:300"); html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } body, input, select, textarea { color: #414f57; font-family: "Source Sans Pro", Helvetica, sans-serif; font-size: 14pt; font-weight: 300; line-height: 2; letter-spacing: 0.2em; text-transform: uppercase; } @media screen and (max-width: 1680px) { body, input, select, textarea { font-size: 11pt; } } @media screen and (max-width: 480px) { body, input, select, textarea { font-size: 10pt; line-height: 1.75; } } a { -moz-transition: color 0.2s ease, border-color 0.2s ease; -webkit-transition: color 0.2s ease, border-color 0.2s ease; -ms-transition: color 0.2s ease, border-color 0.2s ease; transition: color 0.2s ease, border-color 0.2s ease; color: inherit; text-decoration: none; } a:before { -moz-transition: color 0.2s ease, text-shadow 0.2s ease; -webkit-transition: color 0.2s ease, text-shadow 0.2s ease; -ms-transition: color 0.2s ease, text-shadow 0.2s ease; transition: color 0.2s ease, text-shadow 0.2s ease; } a:hover { color: #ff7496; } input[type="text"], input[type="password"], input[type="email"], input[type="tel"], select, textarea { -moz-appearance: none; -webkit-appearance: none; -ms-appearance: none; appearance: none; border-radius: 4px; border: solid 1px #c8cccf; color: inherit; display: block; outline: 0; padding: 0 1em; text-decoration: none; width: 100%; } input[type="text"]:invalid, input[type="password"]:invalid, input[type="email"]:invalid, input[type="tel"]:invalid, select:invalid, textarea:invalid { box-shadow: none; } input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="tel"]:focus, select:focus, textarea:focus { border-color: #ff7496; } input[type="text"], input[type="password"], input[type="email"], select { height: 2.75em; } textarea { padding: 0.75em 1em; } input[type="checkbox"], input[type="radio"] { -moz-appearance: none; -webkit-appearance: none; -ms-appearance: none; appearance: none; display: block; float: left; margin-right: -2em; opacity: 0; width: 1em; z-index: -1; } input[type="checkbox"] + label, input[type="radio"] + label { text-decoration: none; color: #414f57; cursor: pointer; display: inline-block; font-size: 1em; font-weight: 300; padding-left: 2.4em; padding-right: 0.75em; position: relative; } input[type="checkbox"] + label:before, input[type="radio"] + label:before { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-family: FontAwesome; font-style: normal; font-weight: normal; text-transform: none !important; } input[type="checkbox"] + label:before, input[type="radio"] + label:before { border-radius: 4px; border: solid 1px #c8cccf; content: ''; display: inline-block; height: 1.65em; left: 0; line-height: 1.58125em; position: absolute; text-align: center; top: 0.15em; width: 1.65em; } input[type="checkbox"]:checked + label:before, input[type="radio"]:checked + label:before { color: #ff7496; content: '\f00c'; } input[type="checkbox"]:focus + label:before, input[type="radio"]:focus + label:before { border-color: #ff7496; } input[type="checkbox"] + label:before { border-radius: 4px; } input[type="radio"] + label:before { border-radius: 100%; } ::-webkit-input-placeholder { color: #616f77 !important; opacity: 1.0; } :-moz-placeholder { color: #616f77 !important; opacity: 1.0; } ::-moz-placeholder { color: #616f77 !important; opacity: 1.0; } :-ms-input-placeholder { color: #616f77 !important; opacity: 1.0; } .formerize-placeholder { color: #616f77 !important; opacity: 1.0; } /* Button */ input[type="submit"], input[type="reset"], input[type="button"], button, .button { -moz-appearance: none; -webkit-appearance: none; -ms-appearance: none; appearance: none; -moz-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out; -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out; -ms-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out; transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out; display: inline-block; height: 2.75em; line-height: 2.75em; padding: 0 1.5em; background-color: transparent; border-radius: 4px; border: solid 1px #c8cccf; color: #414f57 !important; cursor: pointer; text-align: center; text-decoration: none; white-space: nowrap; } .button1 {background-image: url(images/light_on.png); } input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hover, button:hover, .button:hover { border-color: #ff7496; color: #ff7496 !important; } input[type="submit"].icon, input[type="reset"].icon, input[type="button"].icon, button.icon, .button.icon { padding-left: 1.35em; } input[type="submit"].icon:before, input[type="reset"].icon:before, input[type="button"].icon:before, button.icon:before, .button.icon:before { margin-right: 0.5em; } input[type="submit"].fit, input[type="reset"].fit, input[type="button"].fit, button.fit, .button.fit { display: block; width: 100%; margin: 0 0 0.75em 0; } input[type="submit"].small, input[type="reset"].small, input[type="button"].small, button.small, .button.small { font-size: 0.8em; } input[type="submit"].big, input[type="reset"].big, input[type="button"].big, button.big, .button.big { font-size: 1.35em; } input[type="submit"].disabled, input[type="submit"]:disabled, input[type="reset"].disabled, input[type="reset"]:disabled, input[type="button"].disabled, input[type="button"]:disabled, button.disabled, button:disabled, .button.disabled, .button:disabled { -moz-pointer-events: none; -webkit-pointer-events: none; -ms-pointer-events: none; pointer-events: none; opacity: 0.5; } /* Main */ #main { position: relative; max-width: 100%; min-width: 27em; padding: 0em 3em 0em 3em ; background: #09669c; border-radius: 10px; cursor: default; opacity: 0.95; text-align: center; -moz-transform-origin: 50% 50%; -webkit-transform-origin: 50% 50%; -ms-transform-origin: 50% 50%; transform-origin: 50% 50%; -moz-transform: rotateX(0deg); -webkit-transform: rotateX(0deg); -ms-transform: rotateX(0deg); transform: rotateX(0deg); -moz-transition: opacity 1s ease, -moz-transform 1s ease; -webkit-transition: opacity 1s ease, -webkit-transform 1s ease; -ms-transition: opacity 1s ease, -ms-transform 1s ease; transition: opacity 1s ease, transform 1s ease; } #main .avatar { position: relative; display: block; margin-bottom: 0.0em; } #main .avatar img { /*display: block; margin: 0 auto; border-radius: 100%; box-shadow: 0 0 0 0.8em #cccccc;*/ } #main .avatar:before { content: ''; display: block; position: absolute; top: 50%; left: -3em; width: calc(100% + 6em); height: 0px; z-index: -1; background: #c8cccf; } @media screen and (max-width: 480px) { #main { min-width: 0; width: 100%; padding: 4em 2em 2.5em 2em ; } #main .avatar:before { left: -2em; width: calc(100% + 4em); } } body.is-loading #main { opacity: 0; -moz-transform: rotateX(15deg); -webkit-transform: rotateX(15deg); -ms-transform: rotateX(15deg); transform: rotateX(15deg); } /* Footer */ #footer { -moz-align-self: -moz-flex-end; -webkit-align-self: -webkit-flex-end; -ms-align-self: -ms-flex-end; align-self: flex-end; width: 100%; padding: 1.5em 0 0 0; color: rgba(255, 255, 255, 0.75); cursor: default; text-align: center; } #footer .copyright { margin: 0; padding: 0; font-size: 0.9em; list-style: none; } #footer .copyright li { display: inline-block; margin: 0 0 0 0.45em; padding: 0 0 0 0.85em; border-left: solid 1px rgba(255, 255, 255, 0.5); line-height: 1; } #footer .copyright li:first-child { border-left: 0; } Nie bardzo wiem co z tym dalej zrobić (IMG:style_emoticons/default/questionmark.gif) |
|
|
![]()
Post
#10
|
|
Grupa: Zarejestrowani Postów: 2 592 Pomógł: 445 Dołączył: 12.03.2007 Ostrzeżenie: (0%) ![]() ![]() |
(IMG:style_emoticons/default/closedeyes.gif) Stwórz sobie 2 obrazki dla stanów on i off:
- light_on.png - light_off.png Mała uwaga: masz w kodzie 2 razi div z id='srodek' Jak chcesz możesz sobie przyciski dodatkowo ostylować w CSS. Gotowiec poniżej:
Ten post edytował vokiel 19.01.2016, 10:41:51 |
|
|
![]()
Post
#11
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 15.01.2008 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Zeraz załapałem o divie wiedziaęłm ale miaęłm problem jak wyświetlić grafikę.
Piękne dzięki (IMG:style_emoticons/default/oneeyedsmiley02.png) Teraz tylko drobna kosmetyka nie mogę znaleźć gdzie skasować border tego przycisku Ten post edytował traczu 21.01.2016, 20:58:43 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 26.09.2025 - 01:18 |