• 목록
  • 아래로
  • 위로

아 이번껀 회사 홈페이지가 아니라서 소스 공개 가능합니다. ㅇㅅㅇ 

(푸터에 전번이 있지만 그건 소스 올릴 게 아니라 상관 없긔)

 

1. HTML 구조

<body>

 <nav(메뉴)>

 <wrapper(div)>

  <fieldset 1></fieldset 1>

  <fieldset 2></fieldset 2>

  ... (필드셋 다섯개)

 </wrapper>

 <Footer(div)>

</body>

 

2. full 소스(...) 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.sql.*"%>
    <% request.setCharacterEncoding("UTF-8"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="resources/style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>읽기</title>
</head>
<body>
<jsp:include page="link.jsp" />
<div id="wrapper">

<div id="diary" class="diary">
<%

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    String url = "jdbc:odbc:diary";

    String id = "";

    String pass = "";

    int idx = Integer.parseInt(request.getParameter("idx"));
    int pg = Integer.parseInt(request.getParameter("pg"));

    try {


        Connection conn = DriverManager.getConnection(url,id,pass);

        Statement stmt = conn.createStatement();

        String sql = "SELECT TITLE, TIME, CONTENTS FROM diary WHERE NUM=" + idx;

        ResultSet rs = stmt.executeQuery(sql);

         if(rs.next()){

                String title = rs.getString(1);
                String time = rs.getString(2);
                String cont = rs.getString(3);

%>
<fieldset class="post">
<table>
<tr class="title">
<td width="12.5%" align="center"><img src="resources/048-chat-1.png"></td><td align="left"><%=title %></td>
</tr>
</table>
</fieldset>
<fieldset class="post2">
<table class="table2">
<tr class="cont">
<td width="12.5%" align="center" style="vertical-align:top;"><img src="resources/048-chat-1.png"></td><td align="left"><%=cont%></td>
</tr>
</table>
</fieldset>
<fieldset class="img">
<img src="resources/shinyalolan-sleep.jpg"><br>
<br>
<%=time %>에 작성된 <%=idx %>번째 다이어리<br>
<div class="button">
    <a href="modify.jsp?idx=<%=idx%>&pg=<%=pg%>"><img class="edit" src="resources/edit.png"></a>
    <a href="delete.jsp?idx=<%=idx%>&pg=<%=pg%>"><img class="delete" src="resources/file.png"></a>
    <a href="list.jsp?pg=<%=pg%>"><img class="goback" src="resources/go-back-arrow (1).png"></a>
    </div>
</fieldset>
 <% rs.close(); 
 stmt.close(); 
 conn.close(); 
 } 
         }catch(SQLException e) { } %>
    </div>
        <div id="vclock">
  <fieldset>
  <jsp:include page="Clock.jsp" />
  </fieldset>
  </div>

    </div>
  <jsp:include page="Footer.jsp" />

</body>
</html>

 

3. 해당 CSS

body {font-family:"1훈시나몬베이글"; font-size:15pt; margin-top:4.5%; background:#fff4fd; padding:10px; overflow-x:hidden;overflow-y:scroll; background-image:url('http://koreanraichu.esy.es/wp-content/uploads/2016/12/nihilego_minimalist_wallpaper_by_morshute-dap5pdm.jpg'); background-size:contain;}
html, body {height:100%;}
#wrapper {min-height:100%; position:relative;}
::selection {background-color:navy; color:beige;}
a {text-decoration:none;}
fieldset {border-color:transparent; margin:5px; padding:15px; color:navy; text-align:center; border-radius:15px; background-color:white; opacity:0.7;}
legend {color:blue;}
img {width:27px; vertical-align:middle;}
textarea {font-family:"1훈시나몬베이글"; margin:10px; padding:5px; width:90%; height:100%; box-sizing:border-box; color:navy; border:0px;}
button {outline:0px; border:0px; background:transparent; margin:20px 10px 10px 10px;}

 

#footer {position:absolute;bototm:0;width:100%;height:1em;color:navy;text-align:center;font-size:20pt;padding-bottom:1em;}
#footer a {text-decoration:none; color:steelblue;text-shadow: 3px 3px 2px grey;}

(Footer는 모든 영역에 적용됩니다)

 

4. 그리고 지금 상황

-내용이 짧을 때 

캡처1.JPG

푸터 : 난 그냥 밑에 있을란다 (푸터 가출)

(overflow는 y만 scroll 상태이고 x는 히든입니다. 저렇게 켜두니까 스크롤바가 생기네요;;)

 

-내용이 길 때

캡처.JPG

이 때는 제 위치에 있습니다. (스크롤바도) 

 

5. 그래서 문제가 뭔가요 

wrapper 내에 본문이 있는데 본문 길이가 100%를 넘어가지 않는 짧은 글을 view로 불러올 때도 footer가 화면을 넘어가버립니다. 

그래서 bottom을 0으로 하면 긴 글을 읽을 때(아래 사진처럼 100%를 넘어가는 경우가 긴 글) 푸터가 글 중간에 고정돼버립니다. 

그리고 wrapper의 높이는 아무리 해도 줄어들지를 않고요... 

스크롤바도 글의 길이가 height보다 길 때 나와야 하는데 본문이 있는 필드셋의 높이가 창보다 작은데도 불구하고 스크롤바가 생깁니다... 

 

CSS는 if함수가 안되는건가요? 차라리 그게 되면 넘어갈 때 푸터 여기다 두고 안 넘어갈때는 여기다 두고 이렇게 하고 싶습니다... 

오토요? 그거 씨알도 안 먹혀요... 

작성자
국내산라이츄 102 Lv. (45%) 839700/848720EXP

인생은 양자역학이외다

댓글 0

권한이 없습니다.
번호 제목 글쓴이 날짜 조회 수
공지 [작업 완료] 설 명절 맞이 서버 업데이트 안내 3 마스터 24.02.11.17:21 1591
공지 [중요] 호스팅 만료와 관련하여 일부 수칙이 변경됩니다. 4 마스터 23.01.14.02:23 5302
공지 [필독] 질문하는 방법 17 마스터 18.02.23.03:09 4506
186 PHP) GetText 사용 관련 1 260578 20.06.01.17:02 236
185 핸드폰 유심이 이상해요. 7 슬기 20.06.01.19:18 214
184 AWS elastic inference 끄는 법 아세요? 15 image 국내산라이츄 20.06.03.15:21 181
183 게임 용어에 대해 질문 드립니다 (탱커/딜러/힐러) 21 이니스프리 20.06.05.20:45 2118
182 Chrome와 Safari의 비밀번호 연동이 가능한가요? 10 갱생협스 20.06.06.21:24 127
181 오라클 클라우드로 vpn 구축하는 법? 2 joyfuI 20.06.09.15:44 692
180 JSP의 장단점에 대해 질문 드립니다. 21 이니스프리 20.06.09.21:42 220
179 FTP 로 라이믹스 업로드 중 전송실패가 많다. 2 핫슈 20.06.14.19:51 75
178 퍼티에서 command 뜨면 없다는 것인가요? 2 핫슈 20.06.15.19:55 53
177 ls는 됫는대 압축풀기가 안되내요 ㅜㅜ 핫슈 20.06.16.21:15 42
176 구글과 사파리의 결과값에 차이가 있습니다. 조언 부탁드려도 될까요? 7 image GsusWeb 20.06.18.09:52 75
175 HTML 과 PHP의 연동? 8 GsusWeb 20.06.19.08:34 168
174 코딩하실 때 어떤 브라우저를 기준으로 하시나요? 9 GsusWeb 20.06.19.17:49 129
173 그매햇던것이 라이믹스 에 안올라갑니다. 2 image 핫슈 20.06.19.20:52 73
172 제 블로그 들어갈 때마다 ERR_CONNECTION_RESET 이 오류가 뜨는데 어째서일까요... 9 MYIG 20.06.19.22:53 406
171 사이트의 Slow query가 의심되어서 질문 드려요! ^^ 8 이니스프리 20.06.20.14:02 161
170 호스팅 신청했는데요 도움 좀 부탁드립니다. 24 GsusWeb 20.06.20.21:34 227
169 정전 상태에서 인강을 들어야 되는데요 ㄷㄷ 17 이니스프리 20.06.24.21:51 213
168 웹 페이지에서 알 수 없는 공간을 없애고 싶은데.. 5 GsusWeb 20.06.25.14:59 97
167 오라클 클라우드 프리티어 가입이 안 되네요 ㅠㅠ 20 이니스프리 20.06.26.21:31 4852