• 목록
  • 아래로
  • 위로

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

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

 

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. (29%) 837170/848720EXP

인생은 양자역학이외다

댓글 0

권한이 없습니다.
번호 제목 글쓴이 날짜 조회 수
공지 [작업 완료] 설 명절 맞이 서버 업데이트 안내 3 마스터 24.02.11.17:21 1004
공지 [중요] 호스팅 만료와 관련하여 일부 수칙이 변경됩니다. 4 마스터 23.01.14.02:23 4680
공지 [필독] 질문하는 방법 17 마스터 18.02.23.03:09 4480
886 DB Charset 관련해서 질문 드려요! 4 이니스프리 20.10.01.22:22 137
885 DB를 연결했고 뭔가 가져오는 것 같은데 표시를 못 합니다... 3 image 국내산라이츄 19.05.02.09:37 231
884 DB를 연결했는데 왜 데이터를 가져오질 모태... image 국내산라이츄 19.04.30.17:08 235
883 DNS 관련 질문 (Netlify, CloudFlare) 5 밍원 22.02.14.15:24 202
882 DNS를 찾을 수 없다는데... 8 image 국내산라이츄 17.07.29.22:30 488
881 error page 설정은 어떻해야할까요? 2 슬기 19.11.24.21:27 225
880 ESXi 6.5 이미지 파일 있으신 분 있나요? 6 Seia 17.11.12.19:37 300
879 Expert SSL과 부가서비스 SSL의 차이가 뭔가요? 2 엠씨 17.05.14.23:58 284
878 expert 에 있는 와일드카드 서브도메인이 뭔지 모르겠네요 1 abnoeh 18.03.27.13:23 200
Footer가 글의 길이에 따라 지 알아서 넘어가게 할 수는 없을까요? image 국내산라이츄 17.09.18.14:09 297
876 Freenom 무료 도메인 3 blueone 19.05.27.10:28 504
875 ftp web파일 1 wikiowner 20.11.11.22:16 57
874 ftp 계정명 질문 20 image STULAB 18.07.24.16:10 240
873 FTP 로 라이믹스 업로드 중 전송실패가 많다. 2 핫슈 20.06.14.19:51 75
872 FTP 연결 안됌.... 2 image wikiowner 20.11.06.19:18 78
871 ftp 오류 3 image nx_OP 18.07.22.14:07 793
870 FTP 접속후 설치 화면 아뜨는증상 ? 3 핫슈 18.09.16.14:31 160
869 FTP, FTPS, SFTP, WebDAV를 사용하지 않고 원격지 서버에 파일을 업로드하는 방법이 있을까요? 10 제르엘 22.09.01.14:33 219
868 ftp.studyforus.com은 서비스를 중지하신건가요? 2 260578 19.08.19.18:15 253
867 FTPS 프록시 프로그램이 있을까요? 3 네모 18.06.15.15:42 205