• Najnowsze pytania
  • Bez odpowiedzi
  • Zadaj pytanie
  • Kategorie
  • Tagi
  • Zdobyte punkty
  • Ekipa ninja
  • IRC
  • FAQ
  • Regulamin
  • Książki warte uwagi

Co można by poprawić?

Object Storage Arubacloud
0 głosów
422 wizyt
pytanie zadane 23 listopada 2016 w HTML i CSS przez lapa19904 Stary wyjadacz (11,560 p.)

od jakiegoś czasu uczę się html/css. Chciałbym przedstawić kod mojej drugiej strony podczas pisania której próbuje się uczyć. Na razie jest to single page, jednak docelowo chciałbym aby po kliknięciu w grafikę ewentualnie w "headline" nastąpiło przejście do strony z treningiem konkretnego ćwiczenia lub do filmu na yt. Nie planuje umieszczać strony na żadnym serwerze, a tekst jest skopiowany z różnych artykułów(lorem ipsum jakoś nie do końca mi tam pasuje). Prosiłbym o kilka wskazówek co można poprawić, jak zaprowadzić trochę porządku w kodzie. Problem miał z tym żeby tekst w square ustawiony był na "text-indent:15px;" przez to że wstawiłem tam span, ostatecznie zmieniony na diva.Zamiast text-indent wpakowałem tam kilka    i wygląda to dobrze jednak odnoszę wrażenie jest mocno nieprofesjonalne. 

Co do poprawek to chciałbym aby tyczyły się języków html/css bo oczywiście wiem że o wiele lepiej było by gdyby przejście po kliknięciu na którąś z ikon "menu" do właściwego punktu trwało około sekundę jednak to można zrobić chyba tylko w java scripcie. A z javą wolałbym jeszcze poczekać (nie chcę kopiować gotowych formułek).

<!DOCTYPE HTML>
<html lang="pl">

<head>
		<meta charset="utf-8"/>
		<title>Kalistenika ćwiczenia</title>
		<meta name="description" content="Ćwiczenia bez sprzętu"/>
		<meta name="keywords" content="Kalistenika, street workout, trening bez sprzętu, pompki, brzuszki, podciąganie"/>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<link rel="stylesheet" href="style.css" type="text/css"/>
		<link href="https://fonts.googleapis.com/css?family=Amatic+SC:400,700&amp;subset=latin-ext" rel="stylesheet">
		<link href="https://fonts.googleapis.com/css?family=Molengo|Rambla:400,700|Shadows+Into+Light+Two|Viga&amp;subset=latin-ext" rel="stylesheet">
		
		
</head>

<body>
             
			 <div id="container">
				<div id="logo"><img src="cali.png"/></div>
				<div id="menu">
						<a id="link1" href="#pushup" class="link"><div class="tile">Push up</div></a>
						<a id="link2" href="#pullup" class="link"><div class="tile">Podciąganie</div></a>
						<a id="link3" href="#squat" class="link"><div class="tile">Przysiady</div></a>
						<a id="link4" href="#abs" class="link"><div class="tile">Brzuch</div></a>
						<a id="link5" href="#cardio" class="link"><div class="tile">Cardio</div></a>
						<div style="clar:both"></div>
						</div>
				<div id="opis"><span style="color:#BBFA00">BELIEVE</span> YOU CAN!</br> YOU ARE HALFWAY THERE...</br>
						<div id="tekst">
				There is no question that lately calisthenics has become a buzz in the fitness world. However, this sort of physical activity has been always been around. Just think about the burpees, push up, pull ups and dozens of other aerobic exercises we usually do besides weight training. Bodyweight exercises have always been an important part of bodybuilding and other sports.</div></div>
				<div class="rectangle"><img src="strong.png"/></div>
				<div class="rectangle">
					<div class="square">
					<div class="headline">Push-ups</div>
						
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as a symbol of health and wellness, nothing surpasses the simple push-up. The push-up is the ultimate barometer of fitness. It tests the whole body, engaging muscle groups in the arms, chest, abdomen, hips and legs. It requires the body to be taut like a plank with toes and palms on the floor. The act of lifting and lowering one’s entire weight is taxing even for the very fit.
						
				</div>
					<div class="img" id="pushup"><img src="pushup.png"/></div></div>
				
				<div class="rectangle">
					<div class="img1" id="pullup"><img src="pullup.png"></div>
					<div class="square">
						<div class="headline">Pull-ups</div>
							 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variations are the best exercise in my world. And since I have a lot of experiences in work out choices, pull ups and all the variations of them are without question the best exercise in the world. 

						They add hugely to my overall fitness. They are the core of my workout. If I were born again as a certain animal, I would be probably born as a monkey. That kind of movement seems very natural for me. But it can be very hard for some people. </div></div>
					<div class="rectangle">
					<div style="clear:both";></div>
					<div class="square"><div class="headline">Squats</div>
					Every gym has that one guy who can throw three or four plates on either side of the barbell and squat it like a boss. We've all seen him and thought, "Good golly, what a friggin' badass!" Well, that guy can be you. Although it might seem like squats are reserved for bodybuilders, power-lifters and pro athletes, the truth is anyone can do them. In fact, everyone should do them (and do them properly and safely).

				</div>
					<div class="img" id="squat"><img src="squat.png"/></div>
			<div class="rectangle">
					<div class="img1" id="abs"><img src="abs.png"/></div>
					<div class="square"><div class="headline">ABS</div>
					Abdominal muscles are a key component in athletic ability and part of a well-balanced training program. Abs are the main muscle group in the core, which is the mid section of the body. Abdominal muscles support the upper and lower body increasing muscle control in running, twisting and turning motions used in all sports and other athletic competitions. Athletes strengthen abs for explosive performance and to help prevent injury.</div>
					
					<div class="rectangle">
					<div style="clear:both";></div>
					<div class="square"><div class="headline">Cardio</div>
					As the line between indoor and outdoor exercise continues to blur, what’s becoming clear is that mixing up indoor and outdoor sessions is a great way to keep exercise exciting and, most importantly, fun.</div>
					<div class="img" id="cardio"><img src="cardio.png"/></div></div>
				
				
				
			 
			 
			 </div>
			 <div id="footer">&copy Calistenic Unit 2016</div>
</body>

</html>
body
{background-color: #555555;
margin: 0;
font-family: 'Rambla', sans-serif;
}

#container
{
	width: 100%;
}
#logo
{
 text-align: center;
 margin: 25px;
 margin-bottom: 55px;
}
#menu
{
	width: 100%;
	background-color: #FF3700;
    min-height: 30px;
	padding-left: auto;
	padding-right: auto;
	font-family: 'Amatic SC', cursive;
	font-weight: 700;
	font-size: 25px;
	color: #444444;
	text-align: center;
	
	
}
.link
{
	text-decoration: none;
	color: #333;
}
.tile:hover
{
	background-color:#EE2600;
}
.tile
{
	float: left;
	width: 20%;
}
#opis
{
		font-family: 'Amatic SC', cursive;
		font-weight: 700;
		font-size: 100px;
		text-align: center;
		letter-spacing: 2px;
		
		margin-top: 50px;
		weight: 200px;
}
#tekst
{
	font-size: 32px;
	text-align: justify;
	text-indent: 25px;
	padding: 25px;
}
.square
{
	width: 629px;
	float: left;
	font-size: 34px;
	text-align: left;
	padding-left: 15px;
	text-indent: 40px;
}
.headline
{
	color: #FF3700;
	font-family: 'Viga', sans-serif;
	font-size: 44px;
	font-weight: 700;
	text-align: center;
	letter-spacing:3px;
	
	
}
.img
{
	height: 539px;
	float:right;
	img-size: cover;

}
.img1
{
	height: 539px;
	float: left;
	width: 675px;
	img-size: cover;
}
#footer
{
	clear:both;
	
	color: #FFF;
	min-height: 20px;
	text-align: center;
}

 

5 odpowiedzi

+4 głosów
odpowiedź 23 listopada 2016 przez xmentor Nałogowiec (49,520 p.)
edycja 23 listopada 2016 przez xmentor
chrome=1

Chrome Frame umarł.

<div id="logo"><img src="cali.png"/></div>

Wydaje mi się, że tutaj powinno być h1 + alt dla img z nazwą strony.

Alt-ów brakuje w każdym obrazku.

Menu jest listą, więc niech nią będzie - użyj listy ul.

<div style="clar:both"></div>

Warto poczytać o innych, lepszych metodach clearfix-u.

<div id="opis">
  <span style="color:#BBFA00">BELIEVE</span> 
  YOU CAN!</br> YOU ARE HALFWAY THERE...</br>
<div id="tekst">[...]</div>

Te ostatnie br zbędne, zastąp je margin-bottom, chociaż ten pierwszy br również bym usunął i zastosował akapity.

https://validator.w3.org/ - sprawdź jeszcze jakie inne wyrzuca błędy i je popraw. Outline zerowy.

+4 głosów
odpowiedź 23 listopada 2016 przez Comandeer Guru (600,810 p.)
  • Czcionki można pobrać w jednym arkuszu.
  • X-UA-Compatible powinno być wcześniej w head (najlepiej tuż po deklaracji kodowania).
  • Po [id] raczej się nie styluje (poszukaj sobie tematu na forum, gdzie to omawiałem).
  • Nazewnictwo w kodzie jest strasznie niespójne - warto to poprawić.
0 głosów
odpowiedź 23 listopada 2016 przez Szymon Polaczy Obywatel (1,660 p.)
Nie powiem dużo lecz w css możesz moim zdaniem lepiej wykorzystać kaskadowość tegoż języka
komentarz 23 listopada 2016 przez Szymon Polaczy Obywatel (1,660 p.)
możesz chociażby ustawić w body text-align:center; może da się jakoś ustawić font-size również w body; może również da się ustawić width od razu dla kilku rzeczy. Widze że w container dajesz width:100% a potem tak samo w menu, może da się to skrócić
0 głosów
odpowiedź 26 listopada 2016 przez lapa19904 Stary wyjadacz (11,560 p.)

Bardzo dziękuję za wszystkie cenne wskazówki. Pojawił się też link do validatora który świetnie znajduje błędy, wskazuje niedomknięte znaczniki itp. Super, bardzo przydatne. Dopiero dziś znalazłem trochę czasu aby usiąść nad tą stroną. Wydaję mi się że udało mi się uporządkować trochę ten kod. Główne zmiany:


- px zamiast % (uważam że % nie mają sensu jeśli strona nie jest responsywna, jeśli jestem w błędzie proszę o sprostowanie)

- lista ul w menu zamiast div-ów z float:left;

- img w sqarach wpakowałem jako background-image (wydaje mi się to najlepszym wyjściem biorąc pod uwagę że nie jestem grafikiem, a nie znam innej metody aby dostosować rozmiar img do rozmiaru div-a. Jeśli istnieje to proszę o info. Mam też problem z ustawieniem alt="" jeśli img jest tłem div-a).

- wyrzuciłem img z tekstem wrzucając inne i nakładając na nie widniejący na gołym tle tekst (strona dzięki temu wygląda po prostu atrakcyjniej).

-starałem się lepiej wykorzystać kaskadowość 

Wrzucam kod po poprawkach, proszę jeszcze o ewentualne wskazówki

 

<!DOCTYPE HTML>
<html lang="en">
 
<head>
        <meta charset="utf-8"/>
		 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <title>Kalistenika ćwiczenia</title>
        <meta name="description" content="Ćwiczenia bez sprzętu"/>
        <meta name="keywords" content="Kalistenika, street workout, trening bez sprzętu, pompki, brzuszki, podciąganie"/>
        <link rel="stylesheet" href="style.css" type="text/css"/>
        <link href="https://fonts.googleapis.com/css?family=Amatic+SC:400,700|Rambla:400,700,700i&amp;subset=latin-ext" rel="stylesheet">     
</head>
 
<body>
              
             <div id="container">
                <div id="logo"><img src="cali.png" alt="Logo"/></div>
                <div id="menu">
				<ul>
                        <a id="link1" href="#pushup" class="link"><li class="tile">Push ups</li></a>
                        <a id="link2" href="#pullup" class="link"><li class="tile">Pull ups</li></a>
                        <a id="link3" href="#squat" class="link"><li class="tile">Squats</li></a>
                        <a id="link4" href="#abs" class="link"><li class="tile">ABS</li></a>
                        <a id="link5" href="#cardio" class="link"><li class="tile">Cardio</li></a>
						</ul>
                        <div style="clar:both"></div>
                        </div>
                <div id="opis"><span style="color:#BBFA00">BELIEVE</span> YOU CAN!<br> YOU ARE HALFWAY THERE...
                        </div>
                <div class="rectangle">
				<div class="square"><span>Push-ups</span>
				as a symbol of health and wellness, nothing surpasses the simple push-up. The push-up is the ultimate barometer of fitness. It tests the whole body, engaging muscle groups in the arms, chest, abdomen, hips and legs. It requires the body to be taut like a plank with toes and palms on the floor. The act of lifting and lowering one’s entire weight is taxing even for the very fit.</div>
				<div class="square">
				<div id="pushup"></div></div>
				</div>
				<div class="rectangle">
				<div class="square">
				<div id="pullup"></div></div>
				<div class="square"><span>Pull-ups</span>
				variations are the best exercise in my world.I have a lot of experiences in work out choices, pull ups and all the variations of them are without question the best exercise in the world. They are the core of my workout. If I were born again as a certain animal, I would be probably born as a monkey. That kind of movement seems very natural for me. But it can be very hard for some people.</div>
				</div>
				 <div class="rectangle">
				<div class="square"><span>Squats</span>
				-every gym has that one guy who can throw three or four plates on either side of the barbell and squat it like a boss. We've all seen him and thought, "Good golly, what a friggin' badass!" Well, that guy can be you. Although it might seem like squats are reserved for bodybuilders, power-lifters and pro athletes, the truth is anyone can do them. In fact, everyone should do them (and do them properly and safely).</div>
				<div class="square">
				<div id="squat"></div></div></div>
				<div class="rectangle">
				<div class="square">
				<div id="ABS"></div></div>
				<div class="square"><span>ABS</span>
				- are the main muscle group in the core, which is the mid section of the body. Abdominal muscles support the upper and lower body increasing muscle control in running, twisting and turning motions used in all sports and other athletic competitions. Athletes strengthen abs for explosive performance and to help prevent injury.</div></div>
				<div class="rectangle">
				<div class="square">
				<span>Cardio</span>
				- the line between indoor and outdoor exercise continues to blur, what’s becoming clear is that mixing up indoor and outdoor sessions is a great way to keep exercise exciting and, most importantly, fun.</div>
				<div class="square">
				<div id="cardio"></div></div>	
				</div>
             <div id="footer">&copy Calistenic Unit 2016</div>
			 </div>
</body>
 
</html>
body
{background-color: #222222;
margin: 0;
font-family: 'Rambla', sans-serif;
}
#container
{
	width: 1200px;
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	background-color: #555555;
	margin-top: 0;
	font-size: 32px;
}

#logo
{
	padding-top: 25px;
    margin-bottom: 55px;
}
#menu
{
    background-color: #FF3700;
    min-height: 30px;
    font-weight: 700;
    font-size: 25px;
    color: #444444; 
}
.link
{
    text-decoration: none;
    color: #333;
}
.tile:hover
{
    background-color:#EE2600;
}
.tile
{
    float: left;
    width: 20%;
}
#opis
{
        font-family: 'Amatic SC', cursive;
        font-weight: 700;
        font-size: 100px;
        letter-spacing: 2px;
  		background-image: url(strong.png);
		background-repeat: no-repeat;
		background-position: center top;
		height: 800px;	
}
.square
{
    width: 600px;
    float: left;
	height: 400px;
	display: block;
}
.rectangle
{
	clear:both;
}

#footer
{
    clear:both; 
    color: #FFF;
    min-height: 20px;
    text-align: center;
	background-color: #222222;
}
ul
{
	list-style-type: none;
}
#pushup
{
	background-image: url(pushup.png);
	weight: 600px;
	height: 400px;
	display: block;
}
#pullup
{
	background-image: url(pullup.png);
	weight: 600px;
	height: 400px;
	display: block;
}
#squat
{
	background-image: url(squat.png);
	weight: 600px;
	height: 400px;
	display: block;
}
#ABS
{
	background-image: url(abs.png);
	weight: 600px;
	height: 400px;
	display: block;
}
#cardio
{
	background-image: url(cardio.png);
	weight: 600px;
	height: 400px;
	display: block;
}
span
{
	color: #DD1500;
	font-weight: 700;
}

 

0 głosów
odpowiedź 26 listopada 2016 przez ThePatrykOOO Dyskutant (8,400 p.)
Proste pytanie, czemu menu masz po polsku a treść strony po angielsku, trochę bez sensu. Czemu nie stawisz strony na darmowy hosting bo musiałem specjalnie tworzyć plik.
komentarz 28 listopada 2016 przez lapa19904 Stary wyjadacz (11,560 p.)
Wrzucony, wszystko zmienione na ang.

http://street.cba.pl/

Podobne pytania

0 głosów
1 odpowiedź 467 wizyt
pytanie zadane 22 listopada 2015 w Java przez uczeń1998 Obywatel (1,930 p.)
+1 głos
1 odpowiedź 197 wizyt
pytanie zadane 7 listopada 2015 w Java przez uczeń1998 Obywatel (1,930 p.)
0 głosów
2 odpowiedzi 188 wizyt
pytanie zadane 29 września 2015 w Java przez uczeń1998 Obywatel (1,930 p.)

92,555 zapytań

141,403 odpowiedzi

319,554 komentarzy

61,939 pasjonatów

Motyw:

Akcja Pajacyk

Pajacyk od wielu lat dożywia dzieci. Pomóż klikając w zielony brzuszek na stronie. Dziękujemy! ♡

Oto polecana książka warta uwagi.
Pełną listę książek znajdziesz tutaj.

Akademia Sekuraka

Kolejna edycja największej imprezy hakerskiej w Polsce, czyli Mega Sekurak Hacking Party odbędzie się już 20 maja 2024r. Z tej okazji mamy dla Was kod: pasjamshp - jeżeli wpiszecie go w koszyku, to wówczas otrzymacie 40% zniżki na bilet w wersji standard!

Więcej informacji na temat imprezy znajdziecie tutaj. Dziękujemy ekipie Sekuraka za taką fajną zniżkę dla wszystkich Pasjonatów!

Akademia Sekuraka

Niedawno wystartował dodruk tej świetnej, rozchwytywanej książki (około 940 stron). Mamy dla Was kod: pasja (wpiszcie go w koszyku), dzięki któremu otrzymujemy 10% zniżki - dziękujemy zaprzyjaźnionej ekipie Sekuraka za taki bonus dla Pasjonatów! Książka to pierwszy tom z serii o ITsec, który łagodnie wprowadzi w świat bezpieczeństwa IT każdą osobę - warto, polecamy!

...